Dublin City 2 Longford Town 1: Keen to stress his team would fight to avoid dropping straight back down to the first division, John Gill's players answered their manager's pre-match battle cry with a rousing victory.
It makes things very interesting at the wrong end of the table as this win moves basement-side Dublin to within three points of their nearest rivals and five behind Longford, with a game in hand.
It was a result Longford scarcely needed ahead of their UEFA Cup trip to Liechtenstein next week.
Dublin City, with four changes, including three in defence, found the Longford woodwork inside four minutes when goalkeeper Stephen O'Brien was grateful to see David McGill's speculative cross bounce along his crossbar. Longford responded with Eric Lavine having a shot blocked by Chris Deans.
Longford's finishing was a problem. Alan Kirby volleyed wide before Alan Murphy spurned the best opening of the first half, when Lavine's clever pass put him through one-on-one with Brendan Kennedy, who stood up well to save.
The deadlock was almost broken within a minute of the restart. Somehow, however, Cathal O'Connor made a goal-line clearance after Dean Fitzgerald had set up Lavine to shoot and Dublin survived.
Longford fell behind on 53 minutes. Gary O'Neill got in behind Brian McGovern to set up Philip Hughes who put them in front. Further poor defending cost a second goal on 70 minutes when Derek Griffin headed home Cathal O'Connor's corner.
A terrific save from Kennedy kept out a Shane Barrett header on 83 minutes but Longford finally scored, the first time in five league games, a minute into stoppage time when Fitzgerald shot home following a scramble.
DUBLIN CITY: Kennedy; A O'Connor, Deans, Griffin, Foy; McGill, Colwell, Tierney, C O'Connor (Burke, 90 mins); Hughes (Collins, 83 mins), O'Neill (Crowley, 87 mins).
LONGFORD TOWN: O'Brien; Dillon (Baker, 73 mins), Ferguson, McGovern, Paisley; Kirby, Fitzgerald, Murphy, Prunty (Martin, 38 mins); Lavine, Francis (Barrett, 65 mins).
Referee: P McKeon (Dublin).