Alan Browne leapt through the air and nodded home in injury time as Preston North End staged a daylight robbery to beat Huddersfield Town 2-1 and snatch all three points at Deepdale.
Anders Lindegaard pulled off a string of fine saves to thwart the visitor’s and Browne punished the Terriers lack of bite as he headed home Calum Woods’ sublime cross from the right.
Nahki Wells scored two in the reverse fixture and he remained a thorn in PNE’s side as he popped up in the 80th minute, latched on to substitute Karim Matmour’s defence splitting pass and slid the ball under advancing on-loan West Brom keeper Lindegaard.
Huddersfield looked destined to go on and win the game but just three minutes later PNE - aided by a huge slice of luck - equalised.
Adam Reach smashed the ball towards Gallagher at the back stick and his shot took a deflection off Joel Lynch and beat Jed Steer.
Substitute Eoin Doyle held the ball up before feeding ex-Terrier Woods and the screaming cross was diverted home by Browne despite a diving Steer getting a desperate palm to the ball.
It could have been oh so different as Browne missed the 1.30pm team meeting after his black Range Rover picked up a puncture on the motorway but manager Simon Grayson’s faith in the youngster paid dividends as he grabbed the late winner.
Former Huddersfield manager Simon Grayson made three changes from the side that drew 0-0 at Derby on Tuesday.
Browne - despite his late arrival - returned to the starting XI in place of Daniel Johnson who moved to the bench.
Ben Pearson picked up his tenth yellow of the campaign on Tuesday night and was an enforced absentee.
Paul Huntington - who Wells ran ragged at the John Smith’s stadium - also moved to the bench as Grayson opted for a 4-4-2 formation.
Callum Robinson made his first start for the club since re-joining on loan from Aston Villa and Jordan Hugill made his first start since October.
Huddersfield dominated the first-half and could have taken the lead in the opening 20 minutes but Harry Bunn tamely hit the ball tamely at Lindegaard after running one-on-one .
Lynch nearly opened the scoring in impressive fashion after his effort from distance crashed into bar before bouncing over.
From the subsequent goal kick North End had two great efforts to take the lead as Joe Garner knocked an aerial ball into Hugill’s path.
The striker’s strike was saved by Steer but the rebound fell to Reach who tried to aim for the far corner but skimmed the ball off target.
Garner missed a chance and Lolley curled the ball wide as both sides searched for a goal.
Huddersfield’s Phillip Billing whipped the ball into the path of Wells and the striker’s deflected shot looped into Lindegaard’s arms.
Woods’ tackle accidentally sent Paterson through on goal, the linesman raised his flag, Paterson took his shot anyway but Lindegaard stopped the strike with his face and the ball trickled out. But instead of pulling the ball back for an offside decision the referee overruled his linesman and awarded the Terriers a corner.
Huddersfield kept their foot on the gas in the second half as Lindegaard was called into action to thwart Wells with a one footed save.
Billing found Wells on the edge of the box and he cut the ball to his right and unleashed the over lapping unmarked Smith on the right.
The defender left Lindegaard for dead with a fierce right-footed shot that just whistled past the left post.
Hugill and Robinson made an early exit and moments after Browne headed the ball over.
Lolley’s shot deflected into path of Paterson but he smashed the ball straight at Lindegaard.
Browne steered a neat pass inside to Johnson who twisted and turned before firing the ball straight at Steer from outside the box.
Wells made an audacious appeal for a penalty after he claimed he had been tripped by Woods before spitting his dummy out and having some heated words with Tom Clarke.
Hogg was booked for a cynical foul on Johnson but Huddersfield finally took a deserved lead moments later.
But PNE were not disheartened by the goal and were back in the game minutes later as Gallagher - aided by a wicked deflection off Lynch - drew the host’s level in the 83rd minute.
The midfielder’s strike appeared to be going off target but Lynch’s touch ensured the ball went in.
Wells’ long range shot crashed into the net but fortunately for PNE it slithered past the post before kissing the back of the netting.
But Browne rose highest in injury time to nod home Woods’ cross after some neat hold up play by substitute Eoin Doyle in the second minute of injury time.
The points were not yet in the bag as Huddersfield searched for an equaliser in the dying embers of the match and the 2,245 travelling fans thought they had bundled the ball over the line.
Hogg threw his arms in the air in celebration after claiming that his header was cleared by Lindegaard when he was behind the line.
Referee Darren Drysdale and the linesman deemed that Lindegaard had cleared the ball and North End held on to all three points despite the last gasp dramatics.
PNE: Lindegaard, Woods, Clarke, Wright, Cunningham,Reach (Doyle, 87), Browne, Gallagher, Robinson (Welsh, 58), Garner, Hugill (Johnson, 58). Subs not used: Kirkland, Vermijl, Kilkenny, Huntington.
Huddersfield: Steer, Smith, Hogg, Paterson (Boyle, 90), Cranie, Husband, Bunn (Manu, 78), Lolley (Matmour, 66), Wells, Billing, Lynch. Subs not used: Murphy, Davidson, Whitehead, Dempsey.
Referee: Darren Drysdale (Lincolnshire)
Attendance:12,653 (Away 2,245