Joe Clarke's brilliant 75th-minute solo goal lifted 10-man Wrexham two points clear at the top of the table in a fiery clash at Alfreton.
The teams were tied 1-1 at half-time after Neil Ashton had headed Wrexham ahead from close range, before Ben Tomlinson pounced for an equaliser.
Wrexham had Danny Wright sent off for a second booking in the 49th minute.
The Welsh team were not troubled though and Clarke's dribble and low shot gave Wrexham the points.
Alfreton manager Nicky Law and Wrexham assistant manager Billy Barr were both sent to the stands after separate disagreements with referee Michael Bull.
VIEWS FROM THE DRESSING ROOM
Alfreton Town manager Nicky Law:
"I think we started off the better team then they came back into it and got a poor goal from our perspective. Then again we came back into it and got a good goal and you think you are going to go on and win it.
"They get a man sent off, which is not always a good thing, but when they did we were just void of any ideas, void of anyone to go and make something happen.
"Nathan Arnold has had a glorious opportunity to put us 2-1 up but it doesn't go in and that just gives them a little bit more belief.
"Call it what you want, lack of belief, lack of skill, lack of killer instinct, whatever you want, but that is what we have shown.
"Yes it was against a side who have just gone on to 50 points and top of the table but for me there was nothing between the two teams. They have ground it out and we haven't. That's why we have got a little bit of a weakness."
Wrexham manager Andy Morrell told BBC Radio Wales: "He's [Clarke] produced something out of nothing there tonight and maybe that's the little bit of something that you need to win a game and get you right up in the promotion push.
"A fabulous winner and I thought we defended like lions today and with 10 men. I thought we were great.
"I said at half time nobody get sent off because we have to be 11 v 11 against a team like them. I'm more bothered about the first yellow he [Danny Wright] got than the second one he got.
"It's just petulance kicking the ball away. Players like giving me money. He'll be fined again and at some point it will go in that he just can't do it."
Live Text Commentary
Full Time The referee ends the match.90:00 +2:56
Effort on goal by Anton Brown from just inside the penalty box goes harmlessly over the target.90:00 +0:18
Unfair challenge on Theo Streete by Adrian Cieslewicz results in a free kick. Leigh Franks takes the free kick.88:46
Corner taken by Danny Meadows.87:54
A cross is delivered by Nathan Arnold, Alastair Taylor takes a shot. Save by Joslain Mayebi.84:56
Paul Clayton concedes a free kick for a foul on Chris Westwood. Shot comes in from Martin Riley from the free kick, Phil Barnes makes a comfortable save.83:39 Substitution
Substitution (Alfreton Town) makes a substitution, with Dan Bradley coming on for Matty Harriott.83:39 Substitution
Substitution Alastair Taylor joins the action as a substitute, replacing Josh Law.83:18
Matty Harriott takes a shot from just inside the penalty box which clears the crossbar.83:04
Josh Law takes the inswinging corner, clearance made by Daniel Alfei.81:31
Free kick awarded for an unfair challenge on Ashley Worsfold by Jay Harris. Ross Killock takes the direct free kick.80:23
Adrian Cieslewicz produces a drilled right-footed shot from 18 yards. Save by Phil Barnes. Dean Keates decides to take a short corner.80:05
Adrian Cieslewicz decides to take a short corner.79:22
Foul by Danny Meadows on Neil Ashton, free kick awarded. Neil Ashton restarts play with the free kick.78:33
The ball is delivered by Danny Meadows.76:39
Direct free kick taken by Neil Ashton.76:39 Substitution
Substitution Ashley Worsfold replaces Ben Tomlinson.76:39 Booking
Booking Ben Tomlinson goes into the book.76:25
Neil Ashton fouled by Ben Tomlinson, the ref awards a free kick.74:56 Goal scored
Goal! - Joe Clarke - Alfreton 1 - 2 Wrexham Joe Clarke fires in a goal from inside the penalty area to the bottom right corner of the goal. Alfreton Town 1-2 Wrexham.
Nick Rushton produces a right-footed shot from just outside the penalty box that misses to the left of the goal.72:02
Corner taken by Josh Law, clearance made by Daniel Alfei.71:14
Shot from long distance by Jay Harris goes over the bar.69:21
Ross Killock challenges Jay Harris unfairly and gives away a free kick. Free kick crossed left-footed by Neil Ashton from right channel, Ross Killock manages to make a clearance.68:32
Free kick awarded for an unfair challenge on Jay Harris by Ben Tomlinson. Direct free kick taken by Joslain Mayebi.67:51
Daniel Alfei produces a cross, save made by Phil Barnes.67:19
The ball is delivered by Danny Meadows, save made by Joslain Mayebi.64:18
Matty Harriott takes a shot. Save by Joslain Mayebi.63:48
Danny Meadows crosses the ball, Martin Riley makes a clearance.62:47 Substitution
Substitution Nick Rushton replaces Robert Ogleby.62:29
Daniel Alfei delivers the ball, clearance made by Anton Brown.62:07
Shot by Josh Law. Save by Joslain Mayebi.58:47
Free kick taken by Neil Ashton.58:47 Booking
Booking Theo Streete goes into the book.58:26
Jay Harris fouled by Theo Streete, the ref awards a free kick.56:43
The referee blows for offside against Ben Tomlinson. Joslain Mayebi takes the free kick.54:56 Substitution
Substitution Adrian Cieslewicz on for Johnny Hunt.52:05
Matty Harriott gives away a free kick for an unfair challenge on Jay Harris. Neil Ashton takes the free kick.51:31
Inswinging corner taken by Josh Law from the left by-line, clearance made by Martin Riley.51:24
Danny Meadows produces a cross, Daniel Alfei manages to make a clearance.50:23
Nathan Arnold takes a shot. Save by Joslain Mayebi.49:40
Neil Ashton restarts play with the free kick.49:40 Booking
Booking The referee cautions Danny Meadows for unsporting behaviour.49:33
Danny Meadows concedes a free kick for a foul on Neil Ashton.48:40 Dismissal
Dismissal Danny Wright is sent off by the referee.48:32
Unfair challenge on Leigh Franks by Danny Wright results in a free kick. Free kick taken by Josh Law.47:36
Ben Tomlinson takes a shot. Save made by Joslain Mayebi. Danny Wright gives away a free kick for an unfair challenge on Leigh Franks. Phil Barnes takes the free kick.46:11
Paul Clayton is caught offside. Indirect free kick taken by Joslain Mayebi.45:24
Robert Ogleby concedes a free kick for a foul on Paul Clayton. Free kick taken by Leigh Franks.45:01
The second half has started.45:00 +2:29 Half time
Half Time The match has reached half-time.44:00
Free kick awarded for a foul by Daniel Alfei on Ross Killock. Phil Barnes takes the direct free kick.42:07
Robert Ogleby is ruled offside. Indirect free kick taken by Phil Barnes.40:46
Paul Clayton challenges Neil Ashton unfairly and gives away a free kick. Neil Ashton takes the direct free kick.40:46 Booking
Booking Danny Wright shown a yellow card.37:55
Robert Ogleby is flagged offside by the assistant referee. Free kick taken by Ross Killock.36:42
Foul by Danny Wright on Leigh Franks, free kick awarded. Direct free kick taken by Leigh Franks.36:15
Nathan Arnold has an effort at goal from just outside the box which goes wide of the left-hand post.34:44
Free kick awarded for a foul by Matty Harriott on Dean Keates. Direct free kick taken by Neil Ashton.33:06
The offside flag is raised against Danny Wright. Phil Barnes takes the free kick.32:12
The assist for the goal came from Josh Law.32:12 Goal scored
Goal! - Ben Tomlinson - Alfreton 1 - 1 Wrexham Ben Tomlinson grabs a goal from deep inside the penalty box high into the middle of the goal. Alfreton Town 1-1 Wrexham.31:27
Centre by Josh Law,31:27 Booking
Booking Jay Harris booked.31:12
Jay Harris challenges Anton Brown unfairly and gives away a free kick.28:23
Ben Tomlinson crosses the ball.28:00
Jay Harris delivers the ball, clearance made by Anton Brown.24:36
The assistant referee flags for offside against Johnny Hunt. Phil Barnes takes the indirect free kick.21:54
Free kick awarded for an unfair challenge on Leigh Franks by Danny Wright. Phil Barnes takes the direct free kick.20:53
Centre by Daniel Alfei, blocked by Theo Streete. Outswinging corner taken by Dean Keates from the right by-line, Leigh Franks makes a clearance.20:04
Danny Meadows delivers the ball, Nathan Arnold has an effort at goal from just inside the box that misses to the right of the goal.18:42
Danny Wright challenges Theo Streete unfairly and gives away a free kick. Free kick taken by Phil Barnes.17:00 Booking
Booking Booking for Leigh Franks for unsporting behaviour.16:29
Danny Wright provided the assist for the goal.16:29 Goal scored
Goal! - Neil Ashton - Alfreton 0 - 1 Wrexham Neil Ashton scores a headed goal from close in. Alfreton Town 0-1 Wrexham.14:54
Martin Riley produces a cross, blocked by Josh Law. Corner taken by Robert Ogleby,13:31
The assistant referee signals for offside against Danny Meadows. Neil Ashton restarts play with the free kick.12:30
Anton Brown gives away a free kick for an unfair challenge on Daniel Alfei. Joslain Mayebi takes the free kick.10:00
Josh Law gives away a free kick for an unfair challenge on Joe Clarke. Free kick crossed left-footed by Neil Ashton from left channel, Anton Brown gets a block in.8:43
Chris Westwood crosses the ball, blocked by Theo Streete.7:29
Joe Clarke challenges Theo Streete unfairly and gives away a free kick. Free kick taken by Phil Barnes.7:01
Ross Killock challenges Robert Ogleby unfairly and gives away a free kick. Daniel Alfei takes the direct free kick.4:34
A cross is delivered by Nathan Arnold, Daniel Alfei gets a block in. Corner taken right-footed by Josh Law from the right by-line, Leigh Franks gives away a free kick for an unfair challenge on Neil Ashton. Free kick taken by Joslain Mayebi.2:59
Martin Riley concedes a free kick for a foul on Paul Clayton. Strike on goal comes in from Josh Law from the free kick, Joslain Mayebi makes a save.2:00
Leigh Franks concedes a free kick for a foul on Danny Wright. Neil Ashton restarts play with the free kick. The assistant referee signals for offside against Johnny Hunt. Indirect free kick taken by Phil Barnes.1:21
The ball is delivered by Danny Meadows.1:01
Paul Clayton takes a shot. Save made by Joslain Mayebi.0:20
The ball is sent over by Paul Clayton.0:00
The ref blows the whistle to start the match.
Live data and text provided by our data suppliers