Pope John Paul II said something similar:
(emphasis mine)
All the just of the earth, including those who do not know Christ and his Church, who, under the influence of grace, seek God with a sincere heart (cf. Lumen gentium, n. 16), are thus called to build the kingdom of God by working with...