Late goals from Mathias Pogba and Jake Speight kept up Wrexham's hopes of automatic Conference Premier promotion against strugglers Darlington.
Wrexham looked in control after goals from Speight and Nathaniel Knight-Percival either side of the interval.
But Darlington equalised in the space of two minutes with goals for Adam Rundle and Ryan Bowman.
It was left to a header from Pogba and a 90th minute Speight penalty to seal the victory.
The win has guarantees a play-off spot for Wrexham, who are now six points adrift of leaders Fleetwood but with a game in hand.
VIEWS FROM THE DRESSING ROOM
Wrexham player/manager Andy Morrell told BBC Radio Wales:
"A bit of relief. I thought we were probably the better team. I thought we deserved it.
"But we made hard work of it. We were down and out a little but we managed to galvanise ourselves and nick a win away.
"It's a tough place to come and win."