Praise be to Allah the Lord of the Worlds.
If non-Muslims enter a mosque for a need or hoping to convert, then that is permissible because the Prophet (PBUH) allowed them to enter his mosque. Our scholars said: "Because when the delegation of Thaqif came to the Prophet (PBUH), he allowed them to stay at his mosque although they haven`t converted yet." {Related by Abu Dawoud in Asna al-Matalib}.
However, their entering the mosque is bound by the following key conditions:
First: The aim behind allowing them to enter the mosque is to venerate it and acquaint them with the greatness of Islamic civilization where the mosque represented a beacon of knowledge, piety and righteousness. Allah the Almighty says, "……..in houses which Allah hath allowed to be exalted and that His name shall be remembered therein. Therein do offer praise to Him at morn and evening." {An-Nur, 36}.
Second: The non-Muslim women are asked to cover up when entering the mosque, out of respect and veneration, as it is a place for the remembrance of Allah (Dhikr), prayer and knowledge. Thus, (a woman) showing her adornment to people to whom it is not permissible for her to show isn`t allowed to enter the mosque in such condition.
Third: Making sure that they are invited to Islam since entering the mosque has always been a key reason for their conversion since there they can feel the light, flair and majesty, which warm the hearts and make them wonder about the religion that Allah loves. Our late scholars said: "It is recommended that the non-Muslim asks permission to enter the mosque to listen to Quran, learn about Islamic jurisprudence and Hadith to encourage them to convert. However, if they mock and resist then they should be denied entering the mosque." {Tohfat al-Mohtaaj, vol.9 pp.299}.
Fourth: Making sure that their entering the mosque doesn`t affect those praying, reciting and learning. This because the Messenger of Allah (PBUH) forbade harming worshippers in mosques and creating confusion amongst them. Therefore, it is better not to allow non-Muslims to distract the people of the mosque from engaging in acts of worship. And Allah the Almighty Knows Best.