If a person honestly doesn’t know, God won’t judge them in the way God does those who do know.
God is in all good and loving actions because God is the source of all goodness and love.
Good and kind things unbelievers do are God’s grace, even if they don’t know it.
The Church teaches that God puts a moral conscience in us, even unbelievers.
If a person has moral conscience which is a gift from God to believers and non believers as part of being human, unbelievers who live good kind lives according to moral conscience do have God’s grace in them. They just don’t know it.
1776 "Deep within his conscience man discovers a law which he has not laid upon himself but which he must obey. Its voice, ever calling him to love and to do what is good and to avoid evil, sounds in his heart at the right moment. . . . For man has in his heart a law inscribed by God. . . . His conscience is man’s most secret core and his sanctuary. There he is alone with God whose voice echoes in his depths."47
I. THE JUDGMENT OF CONSCIENCE
1777 Moral conscience,48 present at the heart of the person, enjoins him at the appropriate moment to do good and to avoid evil. It also judges particular choices, approving those that are good and denouncing those that are evil.49 It bears witness to the authority of truth in reference to the supreme Good to which the human person is drawn, and it welcomes the commandments. When he listens to his conscience, the prudent man can hear God speaking.
1778 Conscience is a judgment of reason whereby the human person recognizes the moral quality of a concrete act that he is going to perform, is in the process of performing, or has already completed. In all he says and does, man is obliged to follow faithfully what he knows to be just and right. It is by the judgment of his conscience that man perceives and recognizes the prescriptions of the divine law:
Conscience is a law of the mind; yet [Christians] would not grant that it is nothing more; I mean that it was not a dictate, nor conveyed the notion of responsibility, of duty, of a threat and a promise. . . . [Conscience] is a messenger of him, who, both in nature and in grace, speaks to us behind a veil, and teaches and rules us by his representatives. Conscience is the aboriginal Vicar of Christ.50 "
God is merciful and just.
It is those who believe yet betray their faith who are most under judgement, and those who willfully and knowingly turn their backs on God