Dundalk's prolific hitman, Patrick Hoban, broke Derry City hearts at the Brandywell, his 82nd minute winner securing victory and moving to within one point of the Foyleside club with a game in hand.
And the high tempo game was not without its controversy with the Lilywhites' manager, Stephen O'Donnell, sent off for goading the crowd behind his dugout seconds after Hoban's strike.
Dundalk broke the deadlock in the 10th minute when Robbie Benson let fly from just outside the Derry City penalty area.
Having received the ball from Sam Bone, Benson's superb shot screamed into the top corner giving Brian Maher no chance.
Five minutes later the home side should have levelled matters following a fluent move.
Brandon Kavanagh worked his way forward to find Jamie McGonigle on the right and his perfectly weighted lob into the box found Joe Thomson whose volley was parried wide of his post by keeper, Nathan Shepherd.
Derry managed to work their way back into the game and as they continued to press, McGonigle was unlucky when narrowly failing to latch onto incisive forward passing movements.
But Dundalk were always dangerous, Stephen Bradley smashing a strong drive over the Derry crossbar when taking advantage of a defensive error.
In the 34th minute Thomson was unfortunate for a second time when a long ball from Shane McEleney found Ronan Boyce raiding forward and his high cross saw the midfielder launch into an overhead kick, the ball directed straight into the hands of Shepherd.
Benson proved dangerous yet again but his low shot was parried by Maher and the home support breathed a sigh of relief.
And during injury time at the end of the first half Dundalk's Darragh Leahy came to his side's rescue when he intercepted a threatening Will Patching cross, when diverting the ball wide of his own goal.
Following the change of ends, Derry continued on the front foot with Thomson's tame shot easily dealt with by Shepherd in the 50th minute.
Derry's pressing finally reaped rewards in the 74th minute when they deservedly levelled the score.
Having won a free-kick on the right hand side of the Dundalk penalty area, Patching floated over a superb cross which was met by Derry substitute, James Akintunde, who powered the ball high into the net with a diving header.
The goal clearly lifted the spirits of the home side and, cheered on by their huge support, Derry went close in the 79th minute when McEleney's header following a corner was saved by Shepperd.
But it was Dundalk who had the final say in the 82nd minute. Derry failed to clear the danger and when the ball was fed to Pat Hoban, the striker sent the ball across the body of Maher to find the bottom corner.
Dundalk boss, Stephen O'Donnell, appeared to show his appreciation for the goal to the crowd behind his dugout and that saw referee Rob Harvey produce a red card.
Joe Thomson drove a low shot towards goal from the edge of the Dundalk area, that effort easily gathered by Shepperd and, during the final minutes of injury time another Patching free crashed off the crossbar with Shepperd beaten.
Maher; Boyce (Akintunde, 66), Toal, McEleney, McJannet; Dummigan; Thomson, Patching, Kavanagh; Smith, McGonigle.
Shepperd; Macari (Martin, 76), Connolly, Bone, Leahy; Bradley, Sloggett, Doyle; Kelly (Ward, 58), Benson; Hoban (O'Kane, 90).