The justification of the ungodly is caused by the justifying grace of the Holy Spirit. [ST I-II, Q113, A7]Once again we see that a man cannot justify himself; it is a gift he must receive from God, or he will never be justified at all.
The entire justification of the ungodly consists as to its origin in the infusion of grace. For it is by grace that free-will is moved and sin is remitted. [ibid.]And again:
[T]he remission of sins is caused by the Holy Ghost, as by the gift of God. [ST III, Q3, A8, ad 3; emphasis added]If the remission of sins is caused by the Holy Spirit, and if it is a gift, then it is not something that is earned or merited; otherwise it would not be a gift. Hence we see once again that those who claim that the Gospel proclaimed by the Catholic Church is "works-based" are badly misinformed.