First of all, it should be clear that Allah Almighty never disregards any good deed, be it from a believer or a disbeliever; He gives good reward for it.
Sheikh M. S. Al-Munajjid, a prominent Saudi Muslim lecturer and author, states: “There are two Qur’anic verses in the Qur’an that talks directly about thus topic. The first of them is the verse: “Verily, those who believe and those who are Jews and Christians, and Sabians, whoever believes in Allah and the Last Day and do righteous good deeds shall have their reward with their Lord, on them shall be no fear, nor shall they grieve.” (Al-Baqarah: 62)
The second verse is: “Surely, those who believe, those who are the Jews and the Sabians and the Christians – whosoever believed in Allah and the Last Day, and worked righteousness, on them shall be no fear, nor shall they grieve.” (Al-Ma’idah: 69)
In order to understand these two verses correctly, we need to refer to the scholars of Tafsir. Commenting on the first verse, the great Imam Isma`il ibn Kathir, may Allah have mercy on him, said in his Tafsir (Qur’an exegesis): “Allah, Almighty, points out that whoever of the previous nations did well and was obedient, will have a good reward, and this will be the case for everyone who follows Prophet Muhammad, peace and blessings be upon him, until the Day of Judgment; and they will not fear what they are going to face, nor will they grieve for what they have left behind.
As Allah says: “No doubt! Verily, the awliya’ of Allah [i.e., those who believe in the Oneness of Allah and fear Allah much, and love Allah much], no fear shall come upon them nor shall they grieve.” (Yunus: 62)
And Allah tells us what the angels say to the believers at the time of death: “Verily, those who say, ‘Our Lord is Allah,’ then they istaqamu [stood straight, i.e., truly followed Islam], on them the angels will descend (at the time of their death) (saying): ‘Fear not, nor grieve! But receive the glad tidings of Paradise which you have been promised!” (Fussilat: 30)
As far as the Jews are concerned, their faith meant believing in the Tawrat (original Torah) and following the way of Prophet Musa, peace and blessings be upon him, until Prophet `Isa came, after which whoever continued to follow the Torah and the way of Prophet Musa, and did not follow Prophet `Isa, was doomed. As far as the Christians are concerned, their faith meant believing in the Injil (the Gospel) and following the laws of Prophet `Isa; whoever did this was a believer whose faith was acceptable to Allah, until Prophet Muhammad, peace and blessings be upon him, came, after which whoever did not follow Muhammad, peace and blessings be upon him, and leave the way of Prophet `Isa and the Injil that he had been following before, was doomed.
The Qura’nic verse “And whoever seeks a religion other than Islam, it will never be accepted of him, and in the Hereafter he will be one of the losers” (Al `Imran: 85) is a clear-cut statement that Allah will not accept any way or deed from anyone, after sending His Final Messenger, except those that are in accordance with the laws of Muhammad, peace and blessings be upon him. Prior to this, however, anyone who followed the Prophet of his own time was on the Straight Path of salvation. So the Jews were those who followed Musa, peace be upon him, and referred to the Torah for judgment at that time. When Allah sent Prophet `Isa, peace be upon him, the Children of Israel were obliged to follow him and obey him; so they and others who followed him became Christians. When Allah sent Muhammad, peace and blessings be upon him, as the Final Prophet and a Messenger to all the children of Adam, all mankind was obliged to believe in him and obey him, and refrain from what he prohibited. Those who did so are the true believers. The Ummah of Muhammad, peace and blessings be upon him, are called the believers because of their deep faith and conviction, and because they believe in all the past Prophets and in the prophesied events that are yet to come.”
Commenting on the verse of Surat Al-Ma’idah, Ibn Kathir said:
“What is meant is that every group believed in Allah and the Last Day, which is the appointed Day of Reckoning, and did righteous deeds. But after Muhammad, peace and blessings be upon him, was sent to both mankind and the jinn, true belief can only be in accordance with the way of Muhammad, peace and blessings be upon him. Whoever follows his way will not fear the future or grieve for what they leave behind.”