Who is my mother? Who are my brothers?” And stretching out his hand toward his disciples, he said, “Here are my mother and my brothers. For whoever does the will of my heavenly Father is my brother, and sister, and mother."
From this we derive our teaching regarding the possibility of salvation for those who are not baptized Christians.
Those who, through no fault of their own, do not know the Gospel of Christ or his Church, but who nevertheless seek God with a sincere heart, and, moved by grace, try in their actions to do his will as they know it through the dictates of their conscience—those too may achieve eternal salvation. (Catechism, 847)
This is a very carefully nuanced middle between the two erroneous extremes: those who would say only baptized Christians get into heaven, and those who think that just being nice gets you into heaven.
Following today's gospel the Church teaches that the person seeks God and tries to do his will as they know it through the dictates of their conscience.
For Christians as well the key to our salvation is striving to do God's will.
If we occupy ourselves with that we won't have time to try and figure out who is and is not part of the family. That judgement is left to God. In the meantime we strive to do God's will today, and perhaps our example will bring others into full communion with the family.