Wa `alaykum As-Salamu wa Rahmatullahi wa Barakatuh.
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
1- Islam certainly allows its adherents to pray for their non-Muslim relatives and friends who are still living.
2- However, this is not the case for dead relatives and friends if we are certain that they died in disbelief.
3- In case we are not sure about the faith they died in, we can make a general supplication for those who died in Islam and hence they will be included in our supplication.
Answering your questions, Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states:
We are certainly allowed to make du`aa’ for our non-Muslim relatives and friends who are living. We can pray for them for their health, wellbeing and guidance.
But the most important prayer that we can do for them is to pray for their guidance to the path of Islam. We must do so on a continuous basis.
Our prayer for guidance for them should be complemented by our earnest efforts to persuade them to embrace Islam through wisdom and beautiful preaching. The Prophet (peace and blessings be upon him) said, “By Allah, if a single person is guided by Allah through you, it will be better for you than a whole lot of red camels.” (Al-Bukhari and Muslim)
As for our non-Muslim relatives or friends who have died, we are not allowed to pray for them if we know for a certain fact that they have died in disbelief:
Allah says, “It is not fitting for the Prophet and the believers to pray for the forgiveness of the polytheists, even though they may be near kin (to them) after it has become clear them that they are the people of Hell.” (At-Tawbah 9:113)
Since, according to Islam, every person is responsible for the choice he has made in life, and he has chosen the path of disbelief, we are not to pray for his forgiveness.
If, however, we are not sure what kind of faith they died in, then we are allowed to offer the following general prayer which includes all believers. If they had died in faith they would certainly be included in it; let Allah be the judge:
Allahumma ighfir li al-mu’minia wa al-mu’minat, al-ahya’ minhum wa al-amwat: (O Allah, forgive all believers, males and females, those who are living and those who have died).
We may also pray in the manner of Prophet `Isa (Jesus—peace be upon him), who prayed to Allah concerning the Christians who associated him in the worship of Allah:
“If you punish them, they are Your slaves, and if You forgive them, You are the August, the Wise.” (Al-Ma’idah 5:118)
Almighty Allah knows best.
Excerpted, with slight modifications, from: www.islamicinstitute.ca