Thanks for your question.
First of all, God's sovereignty is a primary principle when considering a question such as this. That is He will hear the prayers of whomsoever He wishes to. However, there is a class of person, in covenant relationship or not, whose prayers go no further than the ceiling. "If I regard iniquity in my heart, the Lord will not hear me:" Psalm 66:18.
A good illustration of the principle of God hearing whom he will is that of Cornelius who we are told in Acts 10 prayed and was heard. Not only was he heard but an angel was dispatched to him. Cornelius was a "God fearer," a gentile who associated himself with Israel but one who, unlike a proselyte, had not made a full commitment to the Covenant of God with Israel. He was not in covenant relationship neither according to the Old Covenant or the New Covenant. Yet the angel said "Thy prayers and thine alms are come up for a memorial before God." What was the result of Cornelius' sincere prayers? God sent Peter to him and he and his household joyfully embraced the New Covenant. His prayers were then heard at a much deeper and effective level than ever before. More than this, his prayers for forgiveness would be answered. That's the key point. Whatever prayers the Father will hear from those outside of His gracious covenant, the prayer for forgiveness must go unanswered. To be forgiven, one must be in covenant relationship with the Father. Since the wages of sin is death. The covenant empowered prayer is one that leads to eternal life. Such a privilege is not available to those outside the covenant. Only within the blessed confines of His covenant of love with His people can forgiveness be found.
One of the chief benefits of maintaining our covenant relationship with Him is the absolute assurance that He will hear us when we pray. We have become His adopted children by belief in the Gospel and by baptism into His son and we thereby have an intimate relationship with Him in prayer that others may not have. A relationship that foreshadows the fullness of fellowship we will have with Him when, at last, He is All in All.
Salvation is on the same basis for everyone. "No one comes to the Father but by me" said Jesus. Such a sentiment may offend our inclinations molded by the humanistic philosophies of this world but it is the Truth. In terms of passing judgment on others, that is not in my sphere of competence. I know that, as Abraham said to the angel, "Shall not the Judge of all the earth do right?" We know what the conditions are for salvation. We have been given the opportunity to meet those simple conditions. We neglect them at our peril. For those who do not have the same benefits that we do or who are too young to understand or who are mentally incapable of understanding, I rest in the Father's righteousness. The Judge of all the earth shall surely do right.