Shildon came away from Thornaby with all three points as they defeated their promotion rivals at Teesdale Park in the Ebac Northern League Division One.
A brace from Dean Thexton and a goal from Aidan Heywood, alongside an own goal from Jamie Poole, gave Shildon a four goal lead 55 minutes in.
Dale Hopson and Jamie Davis pulled goals back for the home side, however Ben Trotter sealed the win for Shildon with his first touch in the 87th minute.
Shildon went into the game off the back of a five game unbeaten run, whilst Thornaby were unbeaten in their last three.
The Railwaymen took the lead just five minutes in, when Thexton dribbled past three Thornaby players in the area before slotting the ball into the bottom corner beyond Dimitrious Konstantopoulas.
The visitors scored their second in the 15th minute, when Aidan Heywood drove forward with the ball before arrowing a shot into the bottom right corner from the edge of the box.
Shildon created most of the chances in the first half, not allowing Thornaby to have a clear sight of goal.
Thexton scored his second in the 49th minute, when David Palmer’s pinpoint pass sent the striker through on goal, before he slotted beyond the keeper.
The away side found themselves four goals up in the 55th minute, when Joe Posthill’s cross was turned into the net by Thornaby defender Poole.
Thornaby were awarded a free kick 25 yards out in the 58th minute, which Hopson took and curled his effort into the top right corner, leaving Shaun Newbrook no chance.
The home side halfed the deficit just six minutes later, when Davis’ effort found its way past Newbrook to pull Thornaby back into the game.
James Frazer almost scored a third for the home side, however his downward header was well saved by Newbrook.
Trotter sealed the win for the Railwaymen in the 87th minute, when he met Michael Sweet’s low cross before slotting home in the bottom corner.
Shildon move up to fifth on goal difference, whilst Thornaby drop down to sixth in the table.