Tiarnan Mulvenna's 87th minute strike broke Shelbourne hearts at Oriel Park as Stephen Kenny's Dundalk returned to winning ways enjoying a 1-0 victory.
Mulvenna, a 69th minute substitute for Vinny Faherty, latched on to a pass from captain Stephen O'Donnell to toe-poke the ball through the legs of Shels keeper Ger Hanley and send the Louth venue into raptures.
It was just rewards for Kenny's men. Dundalk controlled things for much of the game but it looked like ten-man Shels, who had Brian Shortall sent off in the 78th minute, had done enough to hold on for a point.
A poor first-half saw little in the way of chances. Former Dundalk goalkeeper Hanley was able to watch a Dane Massey header fly over in the 21st minute and Keith Ward shot well wide soon after.
The young keeper did breathe a sigh of relief in the 42nd minute when John Dillon jinked past Jack Memery to let fly with a vicious effort but thankfully for Hanley it went just over the top.
Much of Dundalk's best football has come in the second-half of matches this season and they returned after the interval with the bit between their teeth.
The Lilywhites were almost in front in the 48th minute. Hanley, under pressure from Vinny Faherty, let a John Sullivan ball slip from his grasp but O'Donnell - who came through a crowd of bodies to win the rebound - was unlucky to see his effort hit the inside of the post.
Kenny threw Darren Meenan, Tiarnan Mulvenna and Patrick Hoban into the fray in a bid to grab the points. And Mulvenna was involved in an incident that saw the visitors reduced to ten men in the 78th minute when Brian Shortall was shown a straight red for an off the ball incident.
Dundalk pushed forward in numbers after that and O'Donnell thought he had finally broken Shelbourne's resistance with a fantastic left-footed volley from 20-yards that dipped at the last minute and hit the top of the crossbar.
The visitors looked like they had done enough to secure a draw but Mulvenna popped up with three minutes to go to win the day for Dundalk and leave the away supporters calling for manager Mathews' head at full-time.
Dundalk: Peter Cherrie; John Sullivan, Andy Boyle, Dane Massey, Eoghan Osborne; John Dillon, Stephen O'Donnell ©, Richie Towell, Keith Ward (Darren Meenan 63); Vinny Faherty (Tiarnan Mulvenna 69), Kurtis Byrne (Patrick Hoban 75).
Subs not used: John Mountney, Ciaran O'Connor, Stephen McDonnell, Aaron Shanahan (GK).
Shelbourne: Ger Hanley; Ian Ryan ©, Graham Gartland, Brian Shortall, Jack Memery; Craig Mooney (Stephen Sheeran 72), Stephen Hurley (Alex Prizeman 55), Pat Flynn, Sean Brennan; Mark Leech, Philip Hughes.
Subs not used: Philip McCabe, Adam O'Connor, Darren Tinnelly, Jake Donnelly, Eoin Comerford.
Referee: Alan Kelly (Cork).
Highlights and analysis of all the weekend’s action on MNS from 7pm on Monday 13 May on RTÉ Two and RTÉ.ie (Worldwide).