The stage was set early with the halves kicking for territory at every opportunity as Jamie Rooney ensured Whitehaven played deep in the York half looking to force an error.
But the first 40 minutes only produced one try as Scott McAvoy finished off a Rooney runaround to slide in at the corner.
Rooney was unable to add the conversion although York stuttered whenever chances arose for themselves.
Even when Ben Johnston made a superb break before off-loading for Jack Latus to feed Dougie Flockhart, the winger was judged to have a foot in touch before grounding the ball.
The visitors opened the scoring after the break as Cain Southernwood saw referee Dave Merrick out of position to drive his kick towards him resulting in York full-back Tom Carr colliding with the official and Rooney scoring.
York huffed and puffed without really threatening until Flockhart intercepted on his own try line to outpace the visitors’ defence over 80 metres and score.
But any thoughts of a Knights comeback were dispelled as Jackson hit a short ball at pace to break the defence and score under the posts with Rooney’s conversion extending the lead to 12 points.
With York appearing to settle for a bonus point this was denied as Anthony Walker capitalised on poor defence to score in the last minute.
York City Knights: Carr, Elliott, S Latus J Latus, Flockhart, Johnston, Presley, Potter, Lee, Bell, Scott, Mallinder, Smith. Substitutes: Brining, Sullivan, Aldous, Stenchion.
Whitehaven: Cameron, Calvert, Parker, McAvoy, Fleming, Rooney, Southernwood, Houghton, Newton, Jackson, Doran, Clarke, Paterson. Substitutes: Thorman, Barker, Walker, Hand.
Referee: D Merrick (Castleford).