Chris Westwood scored an injury-time winner for Alfreton against former club Wrexham to cement their place in the Conference Premier play-off places.
Mark Carrington had put the Dragons ahead shortly after skipper Neil Ashton missed a penalty.
Alfreton's Michael Wylde headed an equaliser before Job Ayo Akinde's powerful shot squirmed in late on.
Wrexham's Leon Clowes looked to have rescued a point only for Westwood to strike with seconds remaining.
VIEW FROM THE DRESSING ROOM
Wrexham player-manager Andy Morrell told BBC Radio Wales:
"Huge body blow. Thought we played quite well first-half, fairly even but had the better chances and we just had to do the same second-half.
"But when you concede goals from set pieces you're going to struggle and we've struggled for the last three games from set pieces.
"It's not good enough, you've got to go and want to win it and head it in your own box. It's costing us."
Alfreton boss Nicky Law told BBC Radio Derby:
"We came in at half-time and said we felt we could have been a bit sharper and a bit tidier with our decision making.
"We went 2-1 up and Akinde could have had another but he made the wrong decision and then we got hit with a sucker punch and lost our man for the second goal.
"Credit to us, we kept going and I don't think they'll have any complaints that we've won the game."
Wrexham 13 Coughlin 28 Artell 14 Tomassen 17 Clowes 03 Ashton 16 Hunt 26 Anyinsah 21 Evans (Colbeck - 78' ) 29 Carrington 15 Ogleby (Bailey-Jones - 93' ) 10 Ormerod (Morrell - 84' ) Substitutes 25 Bailey-Jones 24 Parle 11 Morrell 18 Colbeck 01 Mayebi Alfreton Town 15 Worsnop 02 Wood 10 Bradley 06 Kempson 04 Westwood 21 Rowe-Turner 05 Wylde Booked 12 Meadows 17 McGrath (Shaw - 46' ) 09 Clayton (Wishart - 72' ) 18 Akinde Substitutes 01 Atkins 20 McFadzean 08 Shaw 14 Taylor 13 Wishart
Ref: Ben Toner