The Prophet (peace and blessings be upon him) said, “prayer is the cornerstone of religion…” Prayer (salah) is the second Pillar of Islam after testifying that there is no god but Allah and Muhammad is His final Messenger. The Prophet (peace and blessings be upon him) said, “Islam is built upon five pillars: testifying that there is no true god except Allah and that Muhammad is the Messenger of Allah, performing prayer, paying the Zakah, making the pilgrimage to the Sacred House (Hajj), and fasting the month of Ramadan.” (Reported by Al-Bukhari)

As for the one who doesn’t offer prayer, he is regarded as a non-Muslim if he denies its obligation, or a sinful Muslim if he doesn’t pray regularly out of laziness. However, abandoning prayer is one of the gravest sins in Islam. Accordingly, we cannot offer funeral prayer for a dead person who denied the obligation of prayer.

Dr. Sano Koutoub Moustapha, professor of Fiqh and Its Principles, International Islamic University, Malaysia, states: “Janazah (funeral) prayer is meant for Muslims only. This means that if the person who has passed away was a Muslim but he or she was not regular in performing prayers, there is no harm as far as Islam is concerned to perform the janazah prayer for him/her. Janazah prayer may help him/her to gain Allah’s forgiveness for his/her negligence and misconduct.
However, if the dead person was not a Muslim, then it is prohibited to perform Janazah prayer for him/her. This is stated in the Glorious Qur’an. Almighty Allah says: “And never (O Muhammad) pray for one of them who dieth, nor stand by his grave. Lo! they disbelieved in Allah and His messenger, and they died while they were evil-doers.” (At-Tawbah: 84)”