A dramatic game at the Showgrounds saw St Pat's almost surrender a 3-0 first-half lead as Sligo Rovers battled back in the last 15 minutes.
Goals from Mark Quigley and Gary O'Neill saw the visitors 2-0 up after 20 minutes, and Anto Murphy added a third five minutes before the break.
But Matthew Judge and Fahrudin Kuduzovic beat Pat's sub keeper Brendan Clarke on 74 and 84 minutes respectively, while Murphy was red-carded for a second bookable offence, leaving the Dubliners hanging on for the win.
The Saints made three changes to their side, with Stephen Paisley, Darragh Maguire and Alan Kirby returning in place of Glen Fitzpatrick, Billy Gibson and John Frost.
Rovers were without defender Seamus Coleman who was on duty with the Republic of Ireland Under-21 side in Sweden, and they stuck with the same eleven that lost to Drogheda last weekend, although Adam Hughes - rumoured to be set for a switch to the league-leaders - was back in the squad and among the substitutes.
The Dubliners enjoyed a bright start, with Murphy particularly lively down the right. But it was from a break through the centre that they opened the scoring in the tenth minute.
Keith Fahey won possession in his own half and cantered forward unchecked before releasing O'Neill. Daniel Ventre got the tackle in, but Quigley latched onto the loose ball and finished skilfully into the corner from edge of the area.
Pat's could have doubled their lead in subsequent minutes as Murphy went close twice from deliveries into the area, but they didn't have too long to wait, with O'Neill nabbing the second in the 20th minute.
The goal came after Rovers failed to fully clear their lines following a Fahey free-kick, and as the defence moved out, Darragh Maguire headed the ball in behind, and Gary O'Neill had the time to gracefully chip the ball over Richard Brush and into the open net.
Rovers offered little early on, with only a stinging free-kick from Fahrudin Kuduzovic worrying Pat's keeper Barry Ryan.
Matthew Gordon, Keith Foy, Matthew Judge and Raffaele Cretaro all had half-chances, but it was no surprise when Pat's went three clear just before the break, with Murphy and Fahey again involved.
Fahey swung in a corner from the left and Murphy swooped from four yards out to head the ball into the net.
Pat's were forced into an early second-half change as Clarke replaced injured keeper Ryan, but Rovers, despite enjoying the majority of possession, failed to test the new netminder.
This prompted manager Paul Cook to make a double switch on the hour-mark, with Brian Cash and Adam Hughes replacing Cretaro and Gordon.
And Rovers were thrown a lifeline on 74 minutes, when Keith Foy headed the ball into area and Judge won possession before smashing the ball into the net off the crossbar from close range.
Amazingly, they struck again ten minutes later when Kuduzovic rifled the net from 25 yards.
But despite having Murphy sent off for a second bookable offence with six minutes remaining, the Saints withstood some late Rovers pressure to seal the victory.