Newry City moved top of the Irish Premier division but they were made to battle all the way by spirited Limavady United.
Emmett Friars put the visitors ahead only for Matthew Boyd to equalise for the Roesiders.
Substitute Sean Friars then put the visitors ahead and Stephen Garrett ensured the victory for the County Armagh side.
In the 15th minute Newry took the lead when Limavady failed to clear a corner and Emmett Friars hooked the ball home after Tony Anderson played the ball back into the box.
Midway through the first half Newry almost went two ahead but Paddy McLaughlin's header was easily saved.
In the 34th minute Limavady should have scored but Ryan McIlmoyle's shot was somehow blocked by Robert Robinson.
The home side equalised in the 56th minute when McIlmoyle's free kick was headed back across the box and Boyd tapped the ball home.
In the 76th minute Newry retook the lead when substitute Sean Friars fired into the far corner from Darren King's cross.
Newry's third came in the final minute of the game when Sean Friars' cross was volleyed home at the back post by Garrett.
LIMAVADY UNITED: Miller, Mullan, Crossan, King, Ferry, McLernon, Curran, Lynch, Stewart, Boyd, McIlmoyle. Subs: Kelly, Kearney, Tommins, Morrison.
NEWRY CITY: Robinson, King, Donegan, McLaughlin, E Friars, Clarke, Prident, McDonnell, Anderson, Garrett, Keegan. Subs: S Friars, Ferguson, Cairns, Curran, Feeney.
Referee: Simon Craney (Newtownards).