Andrew Johnson and Ryan Donaldson had put Morpeth into a two goal lead but the home side hit back with a brace from Mitch Hancox before captain Matty Brown scored the winner in the 89th minute.
Morpeth were roared on by a tremendous away following of 455 fans who were moments away from seeing their side taking York to penalties.
The Minstermen started the game well but they were unable to find a way through the Morpeth defence.
The Highwaymen gradually grew into the game and Micky Turner saw a header from a corner clear the bar after 25 minutes.
It was just a minute later when Morpeth took the lead and it was through Andrew Johnson who registered his 16th of the season. He collected the ball on the left of the box and drove at Michael Duckworth before bending a low effort into the far corner.
York tried to find a way back into the game with Mitch Hancox and Clayton Donaldson going close.
The second half followed the same pattern, but Morpeth weathered the storm and went two goals ahead on 65 minutes with Jack Foalle crossing to the far post where Ryan Donaldson forced his header home at the near post.
Lowson then produced a stunning save to deny Dyson, but York did pull a goal back on 70 minutes when substitute Kurt Willoughby saw his inswinging cross come back off the post and give Hancox the simple job of tapping home on the line.
The goal gave York hope and they equalised on 78 minutes as Hancox reacted first to a ball across the box from Akil Wright after Lowson had made an initial save.
On 79 minutes, Morpeth had the crossbar to thank as Dyson again threatened, but York won the game in the 89th minute as a free kick from Dyson was dinked into the area and captain Matty Brown rose highest to head in.
The Highwaymen are back in league action at Craik Park on Saturday, February 19 when they host Hyde United.