The hosts led 9-3 at half-time, thanks to a hat-trick of Tom Harrison penalties, the visitors responding with a penalty of their own.
The visitors started strongly after the interval and when Scarborough conceded a penalty a quick tap and go from Tony Atkin puts the visitors 10-9 in front.
York dominated the second half and yet another penalty to York saw them crash over between the post, with Shane Goulding the scorer.
Scarborough rallied late on and scored a superb try through Ben Martin to pull it back to 17-14, but York, who were the better team, hung on for the victory.
BUY THE SCARBOROUGH NEWS ON THURSDAY FOR REPORT AND PHOTOS