First, you can rest assured God answers the prayer of an unbeliever or non-Christian when they call upon the name of the Lord in faith. I'm assuming of course that the Holy Spirit has brought the conviction of sin to such a person, as a result of which they repent and seek forgiveness from God.
Second, God is certainly not obligated to answer the prayers of a non-Christian, as John 9:31 and Proverbs 15:29 indicate. Because of His omniscience, however, He obviously hears the prayers of anyone and everyone, whether they are unbelievers, or believers in a "competing" religion, such as Islam.
Third, in the book of the Acts of the Apostles, there is an interesting expression that the author Luke uses to refer to people who are not yet Christians but who obviously believe in God and even have a good reputation among the Jews and the Gentiles. See for example Acts 10:17; 13:43; 17:4 and 17. These God-fearing folks were either converts to Judaism or simply Gentiles who feared God and perhaps even hungered to know God better.
One God-fearing man spoken of in Acts is Cornelius. Though not yet a Christian, Cornelius had prayed to God and was told by a holy angel that his prayers had been answered. Here are Cornelius's words, as recorded in Acts 10:
30 Cornelius said, “Four days ago to this hour, I was praying in my
house during the ninth hour; and behold, a man stood before me in
shining garments, 31 and he *said, ‘Cornelius, your prayer has been
heard and your alms have been remembered before God. 32 Therefore send
to Joppa and invite Simon, who is also called Peter, to come to you;
he is staying at the house of Simon the tanner by the sea.’ 33 So I
sent for you immediately, and you have been kind enough to come. Now
then, we are all here present before God to hear all that you have
been commanded by the Lord.”
I am reminded of the words of the prophet Jeremiah:
You will seek Me and find Me when you search for Me with all your
heart. I will be found by you,’ declares the Lord . . ." (29:13-14).
God hears the heart-seeking prayers of unbelievers. Their hearts, however, must be prepared by God so that they come to realize that Jesus is the One their hearts are seeking.
The apostle Peter, who was called by God to speak to Cornelius, a God-fearer, realized this truth, and he said in the presence of Cornelius and many others who had gathered together to hear Peter,
“I most certainly understand now that God is not one to show
partiality, but in every nation the man who fears[or reverences] Him and
does what is right [or works righteousness] is welcome to Him.
Peter's words certainly shed light on your question.
In short, since God is gracious, merciful, and omniscient, he hears all prayers, and though not obligated to answer those prayers in the way the one who is praying wants them answered, He does answer the prayers of non-Christians, particularly when those prayers are prayed out of reverence for God.
I once had a professor who disagreed with the old saying that there are no atheists in a foxhole, because according to him, he had known men who refused to believe in God even in such dire circumstances, with bullets flying and bombs exploding all around them. Perhaps my professor was right. Nevertheless, God hears the heart-cry of one who reverences Him and who prays to Him in faith.