A crowd of 1,426 saw David Mulcahy mark his 100th game for St Pat's with a late winner at Richmond Park as St Pat's came from behind to steal the points.
Former Saint Mark Quigley put Dundalk ahead on 17 minutes with a stunning strike past Gary Rogers in the Pat's goal. He doubled the lead five minutes into the second half with a cheeky scissors kick.
David McMillan put Pat's right back in the mix on 59 minutes before his brother Evan headed Pat's back on level terms on in the 62nd minute. Mulcahy then fired in the winner in the 89th minute.
A lively opening saw a good goalscoring chance for Dundalk on three minutes that was thwarted by Rogers. Quigley played the ball to Daniel Kearns who in turn squared to Ross Gaynor but Rogers was alert and dashed out to the edge of his box to smother the ball and the chance.
Rogers was eventually beaten in the 17th minutes. A sweeping Dundalk move saw Kearns cross the ball into the Pat's danger area where Jason Byrne laid it on for Quigley to hammer a stunning shot past Rogers to the delight of the away fans packed into the Shed behind the goal.
Pat's went more on the offensive after that setback and offered much in and around the Dundalk box. They should really have got back on level terms on 35 minutes when Anthony Murphy crossed the ball on the deck across the face of goal but David McMillan couldn't make the vital connection to steer the ball past Dundalk goalkeeper Peter Cherrie.
Just like last week against Shamrock Rovers in Tallaght when behind at the break, Pat's came out for the second half looking a different side. They attacked from the off as they went in search of the equaliser.
However, disaster struck for the home side when Quigley netted his second in dramatic fashion on 50 minutes. Kearns and Simon Madden were involved in the build-up on the right, before the came ball fell for Quigley who deftly slotted a fine scissors kick past Rogers.
But the brothers McMillan then turned things around for Pat's during a cracking spell of football that had both sets of fans on the edge of their seats.
Firstly, sub Paul Crowley put David McMillan in to finish with aplomb past Cherrie on 59 minutes. Then on 62 minutes, Stephen Bradley's corner was knocked on by Mulcahy for Evan McMillan to head past the Dundalk netminder.
Both sides had plenty of chances in a barnstorming finish, but it was Mulcahy who snatched the winner on 89 minutes when Duns failed to clear Bradley's corner and the ball fell to him at the far post. A scramble ensued and Mulcahy got the vital touch to bury the ball past Cherrie from close range.