Hartlepool United gifted Macclesfield Town victory after conceding two goals in six minutes at the death at Victoria Park.
Pools appeared on course for three vital points after Michael Woods gave them a 38th-minute lead.
Macclesfield looked no great shakes but the high-fliers struck in the 85th minute when Ryan Lloyd converted sub Elliott Durrell's cross and Keith Lowe headed in from close range in the first minute of added time to stun the hosts
Boss Craig Harrison made two changes to his side for the crucial match.
Nicky Featherstone was ruled out for up to six weeks after scans revealed a fractured fibula after taking a kick at Ebbsfleet last Saturday.
Carl Magnay returned at right-back after making a quick recovery from double hernia surgery, with Liam Donnelly switching to the midfield void left by Featherstone.
Jack Munns came in for his fifth start of the season with Devante Rodney moving down to the bench.
Pools welcomed back Blair Adams after a hip problem with the left-back named on the bench.Luke George was missing after suffering a hamstring strain in training.
The Silkmen were first out of the traps, winning a 32-second corner, from which Lowe shanked wide from the six-yard line, a centre-half finish if you ever saw one.
Despite that early chance, Macclesfield did not look overly-clever and Pools had the better of the play.
But their shooting did not match the approach play, Rhys Oates, Nicky Deverdics and Jake Cassidy all off target while Shwan Jalal saved from Conor Newton.
The Silkmen showed little going forward though Scott Burgess went just wide from distance on 27 minutes.
But Pools were ahead in the 38th minute. Cassidy was the supplier with WOODS showing good footwork and a crisp low shot into keeper's bottom right corner.
Macclesfield won their first free-kick on 40 minutes and it almost led to a goal, but Scott Loach saved a blast from Mitch Hancox.
It was now end-to-end stuff and Jalal got down well to save a low strike from Cassidy.
There was an exciting start to the second half with action at both ends.
Pools threatened to double their lead in the 52nd minute when Harrison made a storming run forward to find Munns who teed up Newton whose shot was held by Jalal.
Newton tried his luck again from range 18 minutes from time, only for the keeper to save diving to his left.
Pools were playing some nice stuff and Munns curled one wide with his left foot after good feet by Magnay and Oates.
Oates was next to have a crack from distance, smashing his long-range shot straight at Jalal.
A low Oates shot was then stopped by Jalal, with Macclesfield going up the other end where Newton made a good block.
Pools were made to pay for not adding a second when the Silkmen levelled five minutes from time.
Sub Elliott Durrell made ground down the right and along the by-line to drive a low cross into the six-yard box where LLOYD slid in to equalise.
And there was time for Pools to give away all three points.
Harrison conceded a free-kick at the death which the Silkmen swung in. The ball came back off the bar and LOWE was there to head into an empty net.
HARTLEPOOL UNITED 1
MACCLESFIELD TOWN 2
Pools: Loach, Magnay, Laing, Harrison, Deverdics, Donnelly (Rodney 90), Woods (Hawkins 85), Newton, Munns (Adeloye 90), Cassidy, Oates.
Subs: Adams, Ledger
Goal: Woods 38
Booked: Magnay 81, Harrison 90
Macclesfield: Jalal, Hodgkiss, Pilkington, Lowe, Fitzpatrick, Whitehead, Lloyd, Burgess (Wilson 65), Whitaker, Hancox (Durrell 53), Marsh (Kennedy 90)
Subs: Ramsbottom, Kennedy, Arthur
Goal: Lloyd 85, Lowe 90+1
Booked: Marsh 69
Referee: Thomas Bramhall (Sheffield)
Att: 3,082 (away 106)