Goals from Robbie Benson and Michael Duffy were cancelled out by an Aaron McEneff penalty and an Eoin Toal tap-in that ensures the Candystripes sit just six points off Stephen Kenny’s side and champions Cork City with a game in hand still to play.
The home side got off to a dream start with a goal after just six minutes as Benson burst onto John Mountney’s cross to slot home.
The Louth men had a big chance to make it two on 14 minutes with Jamie McGrath slipping Pat Hoban in behind the visitors defence only for his effort to be turned around the post by Doherty.
Kenny Shiels’ side grew into the game after that with John Cofie having two chances, neither of which he caught cleanly.
It was still Dundalk looking the most dangerous with Mountney forcing a fine stop from Doherty on 28 minutes Derry were then thrown a lifeline three minutes before the break when McEneff won his side a penalty following a challenge by Daniel Cleary in the box before sending Gary Rogers the wrong way to level things up.
Dundalk would lead at the break however as right on the stroke of half-time Gannon crossed for Duffy to steal in past Darren Cole to slot home.
That lead would last less than two minutes into the second half as a McEneff free was headed goalwards by Ronan Curtis. Rogers got down to save but couldn’t hold the effort as Toal followed up to make it 2-2.
Dundalk then passed up a big chance to retake the lead just after the hour mark. A superb ball from McGrath played Duffy in but just as he was about to pull the trigger Cole slid in to block. The loose ball then wormed its way to Mountney but he pulled his effort agonisingly wide.
Hoban then went close again on 65 minutes when he met Mountney’s corner only to see it blocked on the line by Doherty.
Duffy then almost grabbed a winner nine minutes from the end when he cut in off the left before shooting just wide.
Derry were down to 10 men on 87 minutes when Gavin Peers picked up a second booking for a foul on Chris Shields but they held on.
Rogers; Gannon, Cleary, Hoare, Massey; O’Donnell (Shields 77), Benson; Mountney (Connolly 71), McGrath, Duffy; Hoban (Tagbajumi 78).
Doherty; Cole, Toal, Peers, Doyle; McDonagh, Rory Hale, McEneff, Low, Curtis; Cofie (Boyle 73).
B Connolly (Dublin).