A stunning 93rd-minute header from Patrick Hoban preserved Dundalk's unbeaten home record as they denied Derry City the chance to leapfrog them into second place in the SSE Airtricity League table at Oriel Park.
It looked as though James Akintunde’s 12th-minute strike would be enough for Ruaidhrí Higgins’ side until Hoban popped up with his 135th goal for the club deep in stoppage time.
That denied the Candystripes the chance to close the gap at the top with Shamrock Rovers to six points ahead of their meeting at the Ryan McBride Brandywell Stadium next weekend.
As it stands. it is Stephen O’Donnell’s side who are six points behind the league leaders, albeit with a game more played, but an equaliser was no more than they deserved after bossing the second half.
The home side settled best and carved out the first clear opening on nine minutes when Hoban released Steven Bradley on the right. The on-loan Hibernian winger then pulled the ball back to Joe Adams, whose effort struck Shane McEleney in the face and out for a corner.
A minute later Bradley was in the thick of it again as he was picked out by Greg Sloggett on the right but after cutting in onto his left foot his cross just evaded the inrushing Hoban.
The Candystripes then took the lead with their first attack of note on 12 minutes. Sloggett was caught in possession by Joe Thomson with James Akintunde bursting into the box before firing left-footed across Nathan Shepperd to the bottom right hand corner after Andy Boyle had gone to ground too easily.
Things then went from bad to worse for the Louth men when they lost Paul Doyle and Daniel Kelly to injury within the space of five minutes.
They were then lucky not to find themselves 2-0 down on 35 minutes when the influential Sadou Diallo played Thomson through on goal but a heavy touch allowed Shepperd to smother.
Declan Glass, scorer of an FAI Cup hat-trick on his debut against Oliver Bond Celtic last weekend, curled a shot high and wide.
Dundalk then had a great chance to level in first-half stoppage time when Ryan O'Kane picked the pocket of his former team-mate Mark Connolly before being released through on goal by Hoban but the teenager was denied a first goal for his home town club by a superb save at full stretch by Brian Maher.
Sam Bone then went close to an equaliser within three minutes of the restart when he charged forward from the back before making a mazy run into the box only to pull his left-foot shot agonisingly wide.
Bradley would then go close on 64 minutes when he was released on the right by Hoban but his curling left foot shot just evaded the left hand corner and Sloggett headed just over from a Keith Ward corner.
The visitors’ first chance of the half came in the 79th minute when former Lilywhite Michael Duffy won a free kick - he curled it over the wall but Shepperd was equal to it.
The home fans thought they had an equaliser with seven minutes remaining when Bradley beat Cameron McJannett on the right before seeing his cross laid off by Hoban into the path of O’Kane but the teenager couldn’t get any purchase on his effort under pressure from Diallo, allowing Maher to readjust and make the save as it trickled towards goal.
It looked as though that would be enough for Derry to hang on but up popped Hoban in stoppage time with a stunning header to the top right-hand corner from Bradley’s cross to send Oriel Park into raptures.
🗣️ "It's a big game, it's a big goal, by a big game player"— SSE Airtricity League (@SSEAirtricityLg) August 5, 2022
One of 𝘁𝗵𝗲 𝗯𝗲𝘀𝘁 𝗵𝗲𝗮𝗱𝗲𝗿𝘀 you'll see as Pat Hoban rescues a point late into stoppage time 👏
FT | @DundalkFC 1-1 @derrycityfc #LOI | #LOITV pic.twitter.com/FoJcmy26JK
Dundalk: Nathan Shepperd; Lewis Macari (Robbie Benson 74), Sam Bone, Andy Boyle, Darragh Leahy; Greg Sloggett, Paul Doyle (Alfie Lewis 23); Steven Bradley, Joe Adams (Keith Ward 74), Daniel Kelly (Ryan O’Kane 28); Patrick Hoban.
Derry City: Brian Maher; Cameron Dummigan, Mark Connolly, Shane McEleney, Cameron McJannett; Sadou Diallo, Patrick McEleney; Ryan Graydon (Brandon Kavanagh 77), Joe Thomson (Danny Lafferty 87), Declan Glass (Michael Duffy 77); James Akintunde (Jamie McGonigle 68).
Referee: Rob Hennessy (Limerick).