Shaikhul Islaam Ibn Taymiyyah (may Allah have mercy upon him) was asked:
Question: A group of Muslims are neighbors to Christians. Is it allowed for a Muslim to visit a Christian if he is sick? If he dies, can he follow his funeral? Is it there a sin for the one who does that from the Muslims or not?
Answer: “Allah praise is due to Allah the Lord of the Worlds. He does not follow the funeral. As for visiting him, then there is no harm. That can be a benefit to encouraging him to Islam. If he dies as a disbeliever, then the hell-fire is obligatory upon him. So like this, he cannot pray for him. And Allah knows Best” [Majmoo’ al-Fataawa (24/256)]
This was also the ruling of the Permanent Committee. See here: [https://www.alifta.net/Search/ResultDetails.aspx?languagename=en&lang=en&view=result&fatwaNum=&FatwaNumID=&ID=3005&searchScope=7&SearchScopeLevels1=&SearchScopeLevels2=&highLight=1&SearchType=exact&SearchMoesar=false&bookID=&LeftVal=0&RightVal=0&simple=&SearchCriteria=allwords&PagePath=&siteSection=1&searchkeyword=102117110101114097108032111102032100105115098101108105101118101114#firstKeyWordFound]
Faisal Ibn Abdul Qaadir Ibn Hassan