Winfield’s second-half header moved the Minstermen seven points clear of the bottom-of-the-table Robins with new boss Gary Johnson’s reign getting off to a losing start.
Cheltenham’s Shaun Harrad wasted the best chance to score just before the half-hour mark during a nervy first half from both teams.
The on-loan Notts County striker’s downward header from four yards following Craig Braham-Barrett’s left-wing cross lacked the power to beat recalled home goalkeeper Michael Ingham.
After the break, York wing-back Michael Coulson beat visiting keeper Trevor Carson with an excellent curling free-kick but his effort thudded against an upright.
Stephane Zubar also saw a header cleared off the line by Matt Richards before Winfield pounced on 73 minutes.
He rose highest to meet Luke Summerfield’s corner from four yards at the far post, leaving the Robins three points from safety with six games left.