Wrexham came out on top of this cross-border derby clash but they came under heavy pressure near the end.
Taking a defensive formation into the match, Chester invited pressure and were soon a goal down. It came from Danny Williams heading in from Matt Crowell's corner after keeper Paul Harrison had gone full length to deny Crowell from an earlier effort.
Wrexham should have gone further ahead four minutes later when Sam Williams went down under a tackle from Ben Davies as both went for a corner.
The referee pointed to the spot and up stepped Crowell to take the spot-kick, but Harrison guessed right and kept it out at the foot of his right-hand post with a fine diving save.
City's defence had all sorts of problems and it was no surprise when Wrexham added a second goal. Old hand Darren Ferguson and young striker Matt Derbyshire set up Mark Jones to bend an 18-yard shot round the keeper for a superb goal.
Derbyshire, on loan from Blackburn Rovers, went close with a shot across the keeper, but saw it miss by a couple of feet at the far post and later when he was put clear by fellow striker Sam Williams for a one-on-one with the keeper, he tried a hasty shot that Harrison blocked with his legs.
Chester had a poor first half, not giving Michael Ingham a single save to make. The Wrexham keeper took an easy header from Jake Edwards and when Michael Branch went on a solo run from the halfway line, his shot was blocked by Danny Williams on the edge of the area.
Chester sent on two extra strikers as substitutes later on in the game and saw a big improvement. Ingham maintained Wrexham's lead by saving from substitute Paul Rutherford and then denied Ryan Lowe with another good save.
With time running out Edwards marked his debut with a good goal, evading three tackles before giving Ingham no chance.