Jordan Bowery netted, via his kneecap, after Callum O'Dowda's fierce shot was parried by goalkeeper Michael Ingham.
Ingham kept the hosts at bay before Chey Dunkley's header from a debatable corner extended Oxford's lead.
Danny Hylton then grabbed an exquisite individual goal before Kemar Roofe's top-poke saw him score his 20th goal of the season.
Victory saw Oxford move ahead of Plymouth into second and Hylton's goal was the pick of the night - with the 27-year-old lifting the ball over a defender before taking a touch and curling the ball into the bottom corner.
York remain two points adrift of safety despite Ingham pulling off a number of saves when the score was still at 1-0.
York City manager Jackie McNamara told BBC Radio York:
"I'm angry at how the game finished.
"I thought we had our best spell in the game just before the second goal, which came from a corner but it was clearly our ball. Saying that, we should have the ability to deal with it.
"Once the second goal went in our heads dropped and that reflected in the last bits of our game.
"They're a good side and they can smell blood at that point, and they pushed on."
Oxford United won at home in the league for the first time in 2016 against relegation-threatened York.