In Jesus' parable, ironically, the wicked and the just ask the same question: "When did we see you...?" The wicked simply never noticed anyone other than themselves. The needy, the poor, the despised, the alien and stranger did not deserve their attention. They did not exist in their world. If they noticed anyone it was the wealthier, the more influential and powerful; and they envied them.
The just wonder "When did we see you?" because they were simply doing what comes naturally to anyone inspired by the Holy Spirit. They saw a hungry person, they fed him. They saw the unclothed, the homeless, the sick, the imprisoned and offered whatever help they could. They didn't do it out of piety, for religious reasons. I think that's why, in Jesus' parable, they don't specifically recall caring for the Lord.
They acted generously because human nature, inspired by God's Spirit, acts generously. Without God's spirit, human nature is unnatural.
This is why the Catholic Church recognizes the possibility of salvation for "people of good will" in every nation, regardless of their religion.
And this is why we must announce the gospel to every nation, because knowledge of Jesus Christ -- of his humble birth, simple life, compassionate ministry, defiance of wicked authorities, terrible crucifixion and glorious resurrection -- reveals the Way of God most clearly. We don't have to do anything but be human, realizing that we can be fully human only when we're filled by the Holy Spirit. When we're "washed in the Blood."
Those who worship a god of supreme, overwhelming, irresistible power -- whether they call themselves Christian, Muslim, Buddhist or atheist -- have not heard the story of Jesus. They will not recognize him in the Day of Judgment, nor will he recognize them.