All perfect praise be to Allah, The Lord of the Worlds, and may His peace and blessings be upon our Prophet Mohammad and upon all his family and companions.
According to some Prophetic Narrations, it is permissible for a Muslim to take part in the funeral of a non-Muslim provided that no religious rituals are shared and no violations of Sharia are involved, or else it is forbidden to take part in it. In principle, the permissibility emanates from the Hadith narrated by Ali Bin Abi Talib who said: " I said to the Prophet (PBUH): Your old and astray uncle has died. He said: Go and bury your father, and then do not do anything until you come to me. So I went, buried him and came to him. He ordered me (to take a bath), so I took a bath, and he prayed for me." {Abu Dawoood}.
Ibn Abi Shaibah narrated: "Al-Harith Bin Abi Rabee`a`s mother who is Christian passed away, and the Prophet`s companions took part in her funeral." {Al-Mosannaf, pp.228/vol.3}.
Moreover, it was reported that Abi Wa`el said: "My mother who is Christian passed away, and I informed Omar about that, so he told me: ride a mount and advance in front of her funeral."
In addition, Abdullah Bin Shoraik said: "I heard that Ibn Omar was asked about a Muslim following the funeral of his mother who is Christian? and he said: he should follow her funeral to the graveyard."
Scholars stated that it is permissible to console non-Muslims. They said that a Muslim should say: "May Allah Grant you better than him in exchange", and the like. And Allah Knows Best.