Desperate for points in their battle against the drop, the Spireites side led for five minutes thanks to Kristian Dennis’ 17th goal of the season.
But their joy was short-lived as Graham stepped off the bench and scored with his first touch.
Under light snowfall in Gloucestershire, Drew Talbot shot straight at goalkeeper Scott Flinders in the opening minute for Chesterfield before Jake Andrews thumped a shot just wide at the other end.
Aaron Ramsdale had to parry a swerving effort from Joe Morrell in the 26th minute and the Spireites’ number one palmed away another long range attempt from Nigel Atangana a minute later.
Chesterfield’s first clear chance came in the 32nd minute when a poor headed clearance fell to Kristian Dennis but he completely missed his kick.
Ramsdale made a fine save to keep out Mo Eisa in the 36th minute, with Andrews’ follow-up effort from flying just wide.
Andy Kellett saw a low shot roll agonisingly wide of the far post for Chesterfield in the 42nd minute as Cheltenham’s defence was opened up, but it remained goalless at the break.
Cheltenham substitute Harry Pell seized on a defensive clearance in the 58th minute and thumped a shot wide of the left post.
Eisa went down in the box in the 63rd minute as he tried to reach Taylor Moore’s pass, but referee Ollie Yates waved away Cheltenham’s penalty appeals.
But the breakthrough game in the 74th minute when Dennis capitalised on hesitation between Flinders and Grimes after a ball over from Kellett and the striker rolled the ball into the net to send the away fans wild.
But Graham netted just after taking to the field, finishing low from close range in the 79th minute after a cross from Morrell.
Cheltenham Town: (4-5-1): Flinders 7; Moore 7, Grimes 6 (Rodon 75), Boyle 7, Chatzitheodoridis 7; Dawson 6 (Graham 78 7), Atangana 8, Morrell 7, Winchester 7, Andrews 6 (Pell 54 6); Eisa 6.
Subs not used: Lovett, Lloyd, Cranston, Odelusi.
Chesterfield: (4-5-1): Ramsdale 7; Barry 7, Whitmore 7, Nelson 7, Smith 7; Brown 6 (Dodds 73 6), Talbot 7, Kellett 7, Weir 6, Kay 7 (Binnom-Williams 82); Dennis 7.
Subs not used: O’Grady, Anyon, McGuire, McCourt, Hines.
Referee: Ollie Yates 7/10.