Basement side Stockport had Liam Dickinson to thank for scoring the winner against Chester.
The match appeared to be heading for a draw before Dickinson turned Sean Hessey inside out and unleashed a curling effort beyond Stephane Gillet.
Dickinson had opened the scoring late in the second half when he cut in-field from the right flank and poked the ball beneath the advancing Gillet.
Chester levelled matters when Ryan Lowe rifled in a right-footed shot.
Chester: Gillet, McNiven, Artell, Hessey, Regan, Asamoah (Branch 61), Drummond, Walker, Davies, Tait, Blundell (Lowe 56).
Subs Not Used: Stephen Vaughan, El Kholti, James Vaughan.
Goals: Lowe 81.
Stockport: Spencer, Clare, Ashley Williams, Deharall, Robinson, Hamshaw (Malcolm 77), Allen (Wolski 69), Briggs, Griffin (Singh 62), Bramble, Dickinson.
Subs Not Used: Howarth, Le Fondre.
Goals: Dickinson 76, 89.
Ref: C Foy (Merseyside).