Wrexham were left to rue missed chances aplenty as Chester snatched victory from the jaws of defeat with an injury time winner.
Blaine Hudson gave the reds the lead inside the first minute. However, for all their impressive attacking options Wrexham failed to convert several gilt-edged chances in a one-sided first half and it proved costly when Craig Hobson (74) levelled as the hosts produced a vastly improved display after the break.
Just when it looked honours would end even Ben Heneghan stuck out a hopeful boot and it flew past Dan Bachmann, whose view was partially obscured.
In a cracking derby atmosphere Hudson got Wrexham off to the perfect start after just 58 seconds.
Chester custodian Jon Worsnop could only palm Louis Moult's header into the path of Hudson, who chested it down before picking his spot in the top corner.
Moult almost made it two a few minutes later but he cushioned his volley wide of the target from an acute angle.
Wes York then crashed a long range shot off the bar as Wrexham continued to pour forward to try and end the game as a contest early on.
Jaden Hall forced Dan Bachmann into a smothering save at his near post as Chester enjoyed a rare foray into Wrexham territory.
There was a period of calm after the chaotic blink-and-you'll-miss-it start but Wrexham continued to create the better chances with a 29th minute Connor Jennings chance the best of the lot.
The ball rolled all the way from the left to a loitering Jennings at the far post but he side-footed wide from 12 yards.
A feisty start to the second half saw a flurry of bookings, with Hudson following Seals skipper Kieran Charnock and John Rooney into the book of referee Ross Joyce.
When Bachmann was eventually beaten in the 54th minute the woodwork came to his rescue as Rooney went agonisingly close with a narrowing free kick from distance.
Elliott Durrell, a livewire throughout, then chose the wrong option when he shot at Worsnop from a tight angle instead of cutting the ball back to one of a trio of waiting Reds players with the goal at their mercy.
The slew of missed chances appeared to have proved costly when Craig Hobson back-heeled the ball into the net, but an offside flag preserved Wrexham's slender lead after Bachmann had produced a fine double save.
On 64 minutes Dean Keates entered the fray off the bench for his first taste of football this season after overcoming a hamstring injury as Wilkin sought for a guiding head amongst his tiring troops.
Ten minutes later and Chester drew level. Wrexham failed to heed the warning signs of a dominant second half display by the hosts and Hobson got the faintest of touches to help Rooney's shot into the net.
They continued to ask questions of Wrexham, who failed to match the intensity and desire of their first half showing, and that is what ultimately proved costly as Chester came up with the goods in the dying seconds.
Heneghan stuck his foot on the ball more in hope than expectation and he found the far corner of the net to sink Wrexham when a home win never looked likely for long spells.
Chester: Worsnop, Heneghan, Kay, Charnock, Roberts, James, Rooney, Mahon (Riley 73), Hall (Touray 59), McConville, Hobson (Iwelumo 83).
Subs: Roberts, Harrison.
Wrexham: Bachmann: Ashton, Smith, Hudson, Clarke, Durrell (Holman 81), Moult, Evans (Keates 64), York (Bailey-Jones 76), White, Jennings.
Subs: Tomassen, Bishop, Bailey-Jones, Keates, Holman.
Referee: Ross Joyce (Teeside)
Chester: Charnock (48, foul), Rooney (50, foul)
Wrexham: White (42, foul), Hudson (50, reaction), Bachmann (78, time wasting)