Anderton, 36, emerged as a 55th-minute substitute to awake a dire game and deliver a fitting swansong performance full of fine passing and capped with a memorable winner.
A Mark Molesley cross was headed clear by Chester captain Paul Linwood for Anderton to send a crashing strike from the edge of the 18-yard box into the bottom-left-hand corner before he was mobbed by his team-mates.
Five minutes earlier the former England midfielder thought he had scored when his 35-yard free-kick whistled just past the post before hitting the advertising boards and rolling along the back of the net.
Anderton was given a standing ovation as he left the field as he now can put his feet up following a distinguished career of 477 league appearances and 30 England caps.
Sorry Chester, who continue to slide towards the foot of League Two, lost substitute Tony Dinning to a straight red card after he had elbowed Danny Hollands.