A clinical York performance virtually sealed victory inside 25 minutes as Wrexham relinquished top spot with a first home defeat this season.
Patrick McLaughlin found the top corner after he was teed up by a free-kick to give the visitors a fourth-minute lead.
Jason Walker headed on a long goal kick to create the second, expertly taken by Ashley Chambers with a neat chip.
Poor defending allowed Jamie Reed to smash home a third on 24 minutes, and Wrexham were unable to respond after.
VIEWS FROM THE DRESSING ROOM
York City manager Gary Mills tells BBC Radio York:
"We have had a few displays where we haven't performed like that but we've shown what we are capable of.
"We played how we work on the training field today. We were 'at it' and deserved the three points.
"There's no two ways about it the performances have not been up to it recently."
Wrexham manager Dean Saunders tells BBC Radio Wales:
"I thought York played very well. They've got some good footballers in their team and we didn't cope with them very well.
"It gets a bit easier when you're 3-0 up after 20 minutes but we didn't pack in, which is what I was concerned about.
"I changed the shape of the team to try to stop more damage and hope that we could nick one back early in the second half."