The Candystripes came from a goal down to win at Orierl Park in their final game of the League of Ireland season.
Ciaron Harkin’s strike on the stoke of half-time cancelled out Sean Murray’s opener before Jamie McGonigle put the visitors ahead after half-time.
Derry moved into fourth spot above Bohemians who drew 1-1 at Sligo Rovers.
If St Pat’s win the FAI Cup final against Bohs, Derry will qualify for next season’s UEFA Conference League.
When Ruaidhri Higgins took over at the Brandywell back in April the objective was clear; keep Derry City in the League of Ireland but in his first full managerial post he has exceeded expectations.
Derry had picked up just two points from the first six matches before Higgins arrived but with just six defeats in the 30 remaining fixtures, the Candystripes have a chance of playing European football next season.
Their hopes suffered a dent when Murray wrestled possession from Harkin in the middle of the field before riding the challenge of Darren Cole and unleashing a fearsome drive past Nathan Gartside to give Dundalk the lead.
Raivis Jurkovskis almost gave the hosts a two-goal cushion but his strike was just wide of the post.
Derry responded just before the break when Harkin struck a fine effort from 35 yards as the ball flew into the net via a deflection.
The Candystripes made a bright start to the second period and hit the front on 52 minutes as Joe Thomson released McGonigle before the striker coolly slotted the ball beyond Peter Cherrie in the Dundalk goal.
After a dominant spell the visitors were put under immense pressure and struggled to get out of their own half at times.
When Sam Stanton cut the ball back for Murray on the edge of the area, the Dundalk forward looked certain to net his second but Harkin was back on the line to block the shot.
Patrick Hoban glanced a header just wide of the target late on for Dundalk as Derry held out for a first win at Oriel Park since 2013 before learning that Bohs had been unable to hit a late winner in Sligo.
Derry boss Higgins praised his players as they followed up last weekend’s home win over third-placed finishers Sligo with Friday’s victory.
“Any times there have been questions asked of the players they have answered them emphatically,” said Higgins.
“I looked at this fixture, I’m not going to lie, about three or four weeks ago and I thought it was the last place I want to go (needing to get a result).
“This is a really difficult venue regardless of their league position and they have still got some of the best players in Ireland who can hurt you on any given moment.
“At 1-0 down it just shows their character. Ciaron Harkin has given the ball away for the first goal but then he stepped up on the stroke of half-time and buried one which shows the character that he has.
“We need a favour from St Pat’s but if we can manage to secure European football, what an achievement it would be.”Tags: