Spireites striker Westcarr struck after 13 minutes, but Danny Kedwell equalised for the Gills to ensure they moved to the top of League Two.
Martin Allen's side fell behind when a cross from Terrell Forbes found Westcarr totally unmarked in the six-yard box, allowing the striker to guide the ball home.
The Gills nearly responded immediately as a defensive mix-up almost allowed Kedwell to level, but the former AFC Wimbledon frontman was unable to capitalise.
Kedwell did grab his goal 20 minutes in, heading in Myles Weston's cross off the crossbar to equalise.
Gillingham almost snatched the lead early in the second half, but Deon Burton's effort was cleared off the line by Forbes. And there was still time for late drama as Westcarr was dismissed for a second bookable offence in stoppage time.