Donegal were far from impressive against a Division 3 side who’d bolted the back door on Monaghan, Down and Derry in recent years.
However, the sending off of James McGivney with the game deadlocked at 0-5 to 0-5 on 49 minutes swayed it the way of the home team.
Patrick McBrearty’s five points, added to three frees from Michael Murphy and a couple of well-needed Martin McElhinney scores put Donegal in the hat for Round 3A.
The concession of 1-21 against Tyrone, Gallagher admitted, had hurt his panel.
“We were coming very wounded and very hurt,” Gallagher said afterwards. “We were disappointed in ourselves as a group. We had to keep the chin up and it wasn’t easy.
“If you gave me a five-point victory, would I have taken it? 100%.
“There is a hangover. No matter what way you dress it up, it wasn’t easy to get over it.”
Longford had David McGivney and Robbie Smyth to thank for a 0-4 to 0-3 half-time advantage, although the latter passed up on what would’ve been a goal chance had he opted to catch overhead instead of a flailing flick of both hands when blindsided.
The ball trickled harmlessly wide of Mark Anthony McGinley’s goal.
In the second half, when James McGivney got a second yellow for a foul on Eoin McHugh, it meant Longford, who would kick 17 wides to Donegal’s 16, had lost their entire half-forward line as fellow starters Daniel Mimnagh and Darren Gallagher had already been black-carded.
“The sending-off was the turning point,” Longford manager Denis Connerton said afterwards.
“There was a very difficult wind to play in there and Donegal had many wides also. It was one of those days and the wind was very contrary.
Of his own future, Connerton added: “Well it’s time for me now to sit down and have a good look at my lifestyle. The players are fabulous young men who make many sacrifices in their lives. It’s disappointing to see them out of the championship so early.”
Donegal manager Gallagher believes his team still have a bit to go yet.
He said: “Until we win a few games, the smiles won’t be as strong and won’t be as natural as they should be.
"There is devastation when you don’t win and we’ve had to deal with that. But it’s all part of learning as a team. We held Longford to seven points and we’re happy with that. That was the big thing today.
“We did focus a lot on defending for the two weeks there and that did take an edge off our attacking.”
P McBrearty (0-5, 4 frees); M Murphy (0-3 frees); M McElhinney (0-2); J Brennan, E McHugh (0-1 each)
D McGivney (0-3 frees); R Smyth (0-3, 2 frees); D Masterson (0-1)
MA McGinley; P McGrath, N McGee, C Ward; E McHugh, R McHugh, E Gallagher; M Murphy, J McGee; M Carroll, F McGlynn, M Langan; C Thompson, P McBrearty, M O’Reilly.
M McElhinney for Carroll (28), H McFadden for J McGee (49), J Brennan for O’Reilly (53), M McHugh for McGlynn (55), K Lacey for Langan (56), P Brennan for Gallagher (65).
P Collum; D Masterson, P McCormack, B Gilleran; D t, M Quinn, D Reynolds; John Keegan, D McGivney; D Mimnagh, J McGivney, D Gallagher; R Smyth, L Connerton, B McKeon.
C Berry for Mimnagh (bc, 26), L Moran for Gallagher (bc, 41), A Farrell for McKeon (65), R McIntyre for D.McGivney (65), J Kelly for Connerton (70).
P Hughes (Armagh)