Phil Bardsley and Oumare Tounkara built a 2-0 half-time that proved enough but boss Steve Bruce will have been cheered by the fitness benefits to several key players.
Titus Bramble, Lee Cattermole, Michael Turner and Kieran Richardson all came through the workout unscathed after sustaining injuries that ruled them out at the end of last season, while Gardner made his debut.
Bardsley fired the Wearsiders ahead with just 13 minutes gone, cutting in from the left before firing low past former Black Cat Michael Ingham.
Ingham was beaten again just after the half-hour mark when Tounkara latched onto Cattermole's clever volleyed pass.
The Minstermen's response was lively, Jamie Reed punishing Bramble for felling him in the area, but Gardner went close to restoring the cushion with a thunderbolt free-kick that needed Ingham's intervention.