Dear friend
If a person realises they are in mortal sin, then the Holy Spirit is working in them showing them they are indeed seperating themselves from God, therefore this is a call in itself to rectify this seperation by the Holy Spirit in the Sacrament of reconcilation and penance. That person who knows they are in mortal sin and with full knowledge committed the sin as no sin can be a mortal sin unless the person possess full knowledge, grave matter and intent to flout God’s law, but even then there are circumstances that do not make it a mortal sin, such as state of mind etc when the sin was committed. However, this soul is graced by God and greatly blessed even in their mortal sin, such is God’s love for all humanity, that they should KNOW they are in this grave state of sin and can find peace and forgiveness in Him in the Sacrament of reconciliation.
God hears all prayers regardless of religion, no-religion, or the state of the soul that prays, whoever says them; and no-one can pray without the Holy Spirit moving them to do so, just as the Holy Spirit prompts the soul to know it is in mortal sin, so it also prompts the soul to prayer. This call to prayer is not only for those the person prays for, but also for the soul of the person praying, both are enriched in God;'s love and Blessings. Prayer is healing and peace.
Yes is the resounding answer to your question
God Bless you and much love and peace to you
Teresa