All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and messenger.
The case of the person whom you said that he has no contact with the Muslims and no knowledge of Islam is one of the two following:
1- If he heard about Islam, but he did not try at all to seek to know or search about it, then the ruling that applies to him is the same as that which applies to other non-Muslims. He will be tested in his grave and punished for that.
2- If he did not hear about Islam at all, or he heard of it incidentally but was unable to know about it as it should be, then the ruling on such a person is the same as that of the people of Fatrah (People of the Interval, i.e. everyone whom the message of Islam has not reached in an uncorrupted manner). Some scholars are of the view that they will be tested in their graves, and their answer in the grave will be the same as that on the Day of Judgment according to their conditions and what Allaah Knows about them. Shaykhul Islam Ibn Taymiyyah said: “There are Ahaadeeth that reached the degree of Tawaatur (i.e. being reported by a group of narrators from a group of narrators, generation after generation and so forth, and they are all trustworthy people and it is absolutely impossible for them to agree on a lie) from the Prophet about the questioning in the grave including the Hadeeth of Al-Baraa’ ibn 'Aazib, Anas bin Maalik and Abu Hurayrah and others . These Ahaadeeth generally indicate that all those who are competent for religious assignments will undergo this questioning; with the exception of the Prophets about whom there is a difference of opinion in this regard. Also, there is a difference of opinion concerning people who are not competent for religious assignments like children and insane people. It was said that they will not be tested because being tested in the grave is for those who are competent for religious assignments, and this is the view of the Qaadhi and Ibn ‘Aqeel. Based on this, they should not be instructed or reminded to say the two testimonies of faith after death (when burying them in the grave). It was also said that they should be instructed and reminded to say the two testimonies of faith after death and will be questioned and tested, and this is the view of Abu Hakeem and Abul-Hasan ibn 'Abdoos who reported it from his companions (from the Hanbali School).”
This is in regard to them being questioned. As regards the bliss or torment of the grave, Shaykh Saalih ibn 'Abdul ‘Azeez Aal Ash-Shaykh was asked: “Are the children of the polytheists and the people of Fatrah going to be questioned in the grave and tested?" He replied: “Yes, the questioning is general, and their answer in the grave will be the same as that on the Day of Judgment (according to how their condition will be), and what Allaah knows about them, but they will not enjoy the bliss if they (i.e. children of the polytheists and the people of Fatrah) are from the people of Paradise and they will not be punished if they are among the people of Hellfire, except after the evidence is established against them through a messenger who will be sent to them on the place of gathering on the Day of Resurrection.” [End of quote]
However, it appears to us – Allaah Knows best – that regarding these matters of the unseen it is enough to restrict our knowledge to the revealed texts, and whatever has not been reported by text, we should remain silent about it. Indeed, it is not beneficial to know about such a matter and it is not harmful to not know about it. Indeed, we do not know of any text from the Quran and Sunnah concerning these matters in question.
Allaah Knows best.