The Silkmen'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.
Source: PA
Source: PA