Two goals in three minutes by Dan Fitchett and Angus MacDonald earned a good home win for Salisbury.
Wrexham had led at half time after Joe Anyinsah lifted the ball into the top of the net from Brett Ormerod's quick throw-in.
But Fitchett's 79th-minute header was followed by a cheeky back-heeled finish by MacDonald three minutes later.
And MacDonald denied Wrexham an equaliser when he cleared Robert Ogleby's shot off the line.
VIEW FROM THE DRESSING ROOM
Salisbury City manager Mikey Harris told BBC Wiltshire:
"I'm absolutely delighted with our resolve from being 1-0 down against the run of play. I felt like we could come back and I made a couple of changes at half-time.
"In the second half we showed that bit of quality and we got our rewards.
"Angus's goal was something pretty special that would grace any league.
"Really delighted with the way the lads have worked for each other and put their bodies on the line."
Wrexham manager Andy Morrell told BBC Radio Wales: "There's so many positives to take from the game today, but we just keep conceding goals. One today was a back-heel which was an unbelievable goal really when you watch it back again.
"We were comfortable for 70 minutes, no problems, no issues, then one sloppy back pass and they're in behind us and they've headed in our net and then we're under pressure. Everything that can go wrong is going wrong."
Sorry, we were unable to load match stats, please try again.