Macclesfield Town 3 Wrexham 2
However, Wrexham's late collapse left under-fire manager Brian Carey facing more questions.
Trailing 2-1, Macclesfield drew level in the first minute of four minutes of injury time when former skipper David Morley met a Kevin McIntyre pinpoint cross with a bullet header from eight yards.
They drew level two minutes later when Welsh keeper Anthony Williams made a horrific misjudgement allowing a speculative Danny Thomas cross to loop over his head to the far corner.
Wrexham had dominated the opening exchanges, taking the lead in the sixth minute when their former youngster Jimmy McNulty - now wearing a Macclesfield shirt - clumsily appended slippery striker Michael Proctor in the box.
The former Sunderland man got up off the seat of his pants to casually stroke home a perfect penalty.
They extended their lead on 22 minutes when Mark Jones escaped down the right before picking out the unmarked Chris Llewellyn who chose his spot in the opposite corner from ten yards.
Macclesfield were given a lifeline in the 35th minute when a deep Thomas cross was nodded back across goal by Levi Reid for striker Martin Gritton to head home his fifth of the season.
Gritton had two chances to equalise after the break as McIntyre delivered some quality crosses into the box, but first he headed over the bar before sending another chance wide.
Wrexham will ask questions of youngster Robbie Garrett who, having been booked in the 39th minute, was sent off in the 80th minute after reacting badly when Macclesfield keeper Tommy Lee held him in a headlock.
It left the Dragons under the cosh in the final stages and Macclesfield's pressure finally told.