Well-taken second half goals from Philly Gorman and Kealan Dillon kept Athlone Town's Premier Division survival hopes alive going into the final match of the season.
A first win in 13 matches was wasn't enough to lift Keith Long's side off the bottom of the table, however, as UCD won in Derry.
Athlone, at home to Bray Wanderers in next week‘s final game, now have to better UCD's result when the Students host Drogheda United if they are to leapfrog them to avoid automatic relegation and snatch the play-off spot.
A nervous start by Athlone almost saw them concede within two minutes.
A miss-placed pass by Kevin Knight allowed St. Patrick's Killian Brennan set up Conan Byrne, but his attempted ball to Christy Fagan was cut out by Town keeper Ryan Coulter.
A frantic last-ditched tackle from visiting skipper Alan Byrne then prevented Fagan from giving St. Patrick's the lead on 21 minutes.
Athlone relieved the pressure when threatening for the only time in the first half two minutes later; Gorman's header from Sean Brennan's inviting diagonal ball bringing an attentive save from Brendan Clarke.
St. Patrick's remained dominant, though, and both Brennan and James Chambers threatened before the break in the swirling wind and rain.
Knowing both UCD and Bray were winning at half-time, Town had to have a go and from the resumption. That they did to duly take the lead with a superb goal on 62 minutes.
Gorman initially worked a one-two with Dillon before Eric Foley laid the ball back to the Town striker who hit a sweet right-foot drive to the top corner from 25-yards.
Dillon should have doubled the lead four minutes later. But, played in by Gorman, his drive was brilliantly saved with his feet by Clarke.
But the midfielder made amends on 68 minutes. Brennan, fouled by brother Killian, took a quick free kick to put Dillon in on goal and he made no mistake by firing past Clarke at the near post.