I'd like to know how Catholic spiritual masters explain the urge to pray. Is it considered inspired by the Holy Spirit? Should we surrender to that urge? I was doing some research on that topic, but I didn’t find any reference from a Catholic perspective.
The Holy Ghost gives grace to help us begin to pray.
"Should we surrender to that urge?" We should "pray without ceasing" (1 Thes. 5:17).
Since we cannot do anything without Christ (Jn. 15:5: "without me you can do nothing"), the Holy Ghost needs to give us initial, prevenient* grace before we can even begin a good action of prayer.
*"Prevenient" literally means "coming before"; prevenient grace is the initial unmerited grace that comes before other graces.
We grow in charity by making more intense acts of charity, which are begun under the Holy Spirit's initiative. Prayer is a means toward the end of growth in charity (perfection).
Without the actual prevenient grace, man can do absolutely nothing in the supernatural order, and without the more intense grace, the more intense act [of charity] is impossible. That actual grace which is more intense cannot be merited, for this would be a contradiction*; but it can be infallibly impetrated [asked of God], although under a gratuitous title, through prayer which fulfills the necessary conditions.
*Because then the effect (more intense charity) would be greater that the cause (less intense charity); cf. axiom 6.4: "The cause is greater than the effect."
Every change (e.g., from a state of non-prayer to a state of praying) is due to God, the Unmoved Mover / Unchanging Changer.