Derry moved to within a point of promotion back to Division One as they rallied late to hold off a brave fightback from 14-man Louth.
Playing with the aid of a huge wind in icy-cold Drogheda, the Oak Leafers had a nightmare start when Ciaran Byrne won a penalty after barely 30 seconds, which Shane Lennon rifled home.
But within five minutes, Raymond Wilkinson had won a spot kick at the other end and James Kielt sent Gallagher the wrong way. That helped the Oak Leafers go into a 1-9 to 1-4 lead at the break.
Scores from Enda Lynn and Gerard O'Kane were the perfect start to the second half for Brian McIver's men but with Derry six up, the whole game turned in a few seconds.
James Kielt smashed one off the underside of the bar and Louth came down the field to point through Ciaran Byrne. During the move, Mark Brennan tangled with Carlus McWilliams off the ball and the Louth man was sent off for stamping.
However, Louth got the bit between their teeth and with the introduction of Darren Clarke making a difference, they dragged themselves level at 1-12 apiece.
They couldn't get ahead though. Eoin Bradley was outstanding for Derry after being introduced early in the first half, and two pointed frees from him gave Derry back their lead. Derry finally put it to bed in injury time when Benny Heron hit the roof of the net.
The win for Derry means a point from their last game at home to Westmeath would be enough to send them up, and into a league final against the same opposition.
Scorers: Derry: James Kielt 1-3 (1-0pen, 0-3f), Eoin Bradley 0-4f, Lee Kennedy 0-3, Enda Lynn 0-2, Gerard O'Kane 0-2, Benny Heron 1-0
Louth: Shane Lennon 1-4 (1-0pen, 0-4f), Brian White 0-2 (0-1f), Kevin Rogers 0-2 (0-1f), Derek Crilly 0-1, Ciaran Byrne 0-1, Conor Rafferty 0-1, Darren Clarke 0-1
Louth: N Gallagher; P Rath, D Finnegan, G Hoey; J O'Brien, D Crilly, A Reid; R Carroll, B Donnelly; A McDonnell, M Brennan, B White; C Byrne, S Lennon, K Rogers
Subs: D Maguire for Hoey (HT), C Rafferty for Carroll (48), D Clarke for Rogers (51), J McEnaney for Byrne (64)
Derry: E McNicholl; A McAlynn, C McKaigue, C McWilliams; C Kielt, G O'Kane, SL McGoldrick; P Bradley, PJ McCloskey; M Bateson, J Kielt, E Lynn; D Heavron, L Kennedy, R Wilkinson. Subs: E Bradley for Bateson (20), B Heron for Kennedy (56), D Brown for McWilliams (60), C Devlin for Wilkinson (70)
Referee: M Higgins (Fermanagh).