Praise be to Allah.
Shaykh al-Islam Ibn Taymiyah was asked about Muslim people who have Christian neighbours – is it permissible for a Muslim to visit a Christian if he gets sick, or to attend his funeral if he dies? Is there any sin on a Muslim who does these things, or not?
He replied:the Lord of the Worlds. He should not attend his funeral, but visiting him when he is sick is fine, because this may serve an interest, namely opening his heart to Islam. But then if he dies as a kaafir, he will deserve Hell, hence the prayers should not be offered for him. And Allaah knows best.