Limerick went close to open the scoring on 27 minutes but Town keeper Craig Hyland saved Paudie Quinn’s low drive from a Denis Behan through ball.
Hyland then kept out Behan’s long-range effort and denied Shaun Kelly with a stunning save before the break.
Noel Haverty edged the visitors ahead in the 53rd minute with a far post header from a Mark Salmon flick-on.
Limerick drew level ten minutes from time when Haverty handled a Corie Tracy cross and Shane Tracy buried the resulting penalty.
But the hosts’ parity was short-lived as Colm James headed home a Gary Shaw cross from the left less than two minutes later.
LIMERICK FC: Ryan, Kelly, Purcell, Gutherie, Bhandarkar (Gaffney 54) Gamble, Tracy, McGann (Bradley 69), Quinn (Brosnan 62) Behan, Treacy.
LONGFORD TOWN: Hyland, Haverty, Crawley, Hope, Deane, Kirby (Lee 90+), Gillespie, Salmon, Bermingham (Skelly 54 inj, Purdy 65) Shaw, James.
Referee: C Fitzgerald (Dublin).