Chesterfield had to stage a second-half comeback to claim the 2-1 victory over Macclesfield that takes them to the brink of promotion.
A penalty from Lewis Chalmers gave Macclesfield a surprise lead but Craig Davies struck his 24th goal of the season to restore parity before Danny Whitaker's grabbed the winner.
Macclesfield's determination was summed up by skipper Nat Brown who hurled himself at the feet of Jack Lester to deny the striker a certain goal in the 29th minute.
Brown could not continue but his bravery was rewarded in first-half stoppage time when substitute Emile Sinclair was tripped by Dean Holden and Chalmers coolly converted the spot-kick.
Chesterfield thought they had equalised in the 49th minute but an offside flag ruled out Lester's header and it needed a reaction save by Lee to deny Tyrone Barnett a second four minutes later.
It was a pivotal moment because in the 60th minute, Sam Wedgbury lost the ball to Davies who smashed a shot into the top-left corner.
Whitaker rattled the bar in the 74th minute but the midfielder hit the net two minutes later with a deflected effort.