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."
Wrexham 25 Mayebi 02 Obeng (Creighton - 46' ) 03 Ashton 23 Westwood 06 Harris 08 Fowler Booked 18 Tolley (Cieslewicz - 69' ) 20 Knight-Percival 10 Speight 11 Morrell (Keates - 46' ) 24 Pogba Booked Substitutes 04 Creighton 07 Cieslewicz 12 Keates 17 Little 19 Anorllo York City 24 Ingham 03 Meredith 05 McGurk 16 Fyfield 08 Kerr Booked 15 Boucaud (Potts - 69' ) 20 Challinor 26 McLaughlin 07 Reed (Blair - 66' ) 09 Walker 10 Chambers Substitutes 04 Smith 06 Parslow 13 Potts 17 Blair 11 Henderson