Craig Mahon scored a dramatic late winner for the blues as they stretched their home unbeaten record to five games.
Alfreton took the lead courtesy of a classy finish by Tom Shaw, before Fleetwood loanee Matty Hughes equalised. Then, Mahon clinched the win two minutes into stoppage time.
Steve Burr's side started this game brightly, as John Rooney's vicious shot from the edge of the box was palmed away by Cameron Dawson. Minutes later, Matty Hughes cut inside and had an effort which was brilliantly tipped over one handed by the keeper.
However, Chester then fell behind. It was a promising run forward by Joe Ironside who cut inside and laid a reverse pass for Thomas Shaw who rolled the ball through Jon Worsnop's legs and into the far corner to give the visitors the lead inside the first quarter of an hour of the match.
But the blues did respond. John Rooney had two successive shots which were wide of the mark, before Sean McConville was brilliantly shut out by a defensive block after he found some space 10 yards out.
Nevertheless, Alfreton had a brilliant opportunity to double their lead just short of the half hour mark when Thomas Davies won a header completely unmarked, but he could only head the ball just over.
But Steve Burr's side took advantage of that miss and were level minutes later. Loan signing Matty Hughes brilliantly cut inside and smashed a shot underneath the keeper the draw Chester level. Moments later, the blues nearly found themselves ahead with a sweeping move that involved Hughes, Gareth Roberts and Craig Hobson - with the latter volleying over from close range.
Chester then dominated the second half for large periods, and had plenty of chances. Firstly Rooney and then Hobson were denied by good low stops by Dawson, before Hobson sidefooted a shot beyond the keeper which crept just wide after being played in behind by McConville. Substitute Jamie Menagh then volleyed over a fierce effort from the edge of the box.
Then, the stage was set for Craig Mahon to be the hero. With two added minutes played at the end of the match, Menagh sent in an excellent back post cross and Mahon remarkably managed to connect with a backheel lob which crept slowly over the keeper and into the net, to send Chester up to 13th.
Chester: Worsnop, Heneghan, Kay, Charnock (c), Roberts, James, Rooney, Mahon, McConville, Hobson (Menagh 76), Hughes.
Subs Not Used: C Roberts, Harrison, Touray, Winn.
Goals: Hughes 30, Mahon 90+2;
Alfreton: Dawson, Davies, Courtney (c), Graham, Rowe-Turner, Howell, Wood, Shaw, Mellor (Bradley 49), Hawley (Keane 79), Ironside (McDonald 63).
Sub Not Used: Sheridan.
Goal: Shaw 15.
Man of the Match: Kingsley James