Carnegie led the tie - played at Hull Ionians’ Brantingham Park - by 23 points at the interval, Dan Temm and Harry Davy’s tries complementing a fine kicking display from Jacob Umaga who landed six goals from as many attempts.
Chris Elder extended Yorkshire’s lead before, aided by two yellow cards to the hosts, Doncaster scored three tries in the final 13 minutes through a Ben Hunter brace and Curtis Wilson.
Watched by former Carnegie and England coach Stuart Lancaster, it was only Yorkshire’s third victory of the season and ended Knights’ three-match winning run.
Full-back Umaga, in his third game for Yorkshire on loan from Wasps, kicked two early penalties before Dougie Flockhart replied in similar fashion for Doncaster.
That came soon after Paul Jarvis had sliced through Carnegie’s defence from Cameron Cowell’s pass, but referee Simon Harding ruled out the touchdown because of an obstruction.
Knights spent the rest of the half defending, but conceded two tries by handing opposition to the hosts.
On 29 minutes, after Umaga had booted his third penalty, Doncaster turned the ball over near their own line and Temm galloped through a huge gap to score a converted try.
Umaga landed another penalty four minutes before the break and on the last play of the half Jarvis’ pass was intercepted by Davy just inside Knights’ half and the winger scored unopposed, Umaga maintaining his 100 per cent record with the conversion.
Umaga went off early in the second half so it was Jade Te Rure who converted Carnegie’s third try on the hour, Elder finishing off after JB Bruzulier and Te Rure had combined in front of the posts.
Temm was sin-binned on 66 minutes and Knights pulled a try back moments later when Hunter touched down following a lineout near Carnegie’s line, Flockhart adding the extras.
Carnegie were reduced to 13 men when Will Britton was sin-binned yellow carded six minutes from time and Curtis Wilson immediately took advantage to score a fine solo try and Hunter added his second, with a drive from a lineout, to complete the scoring in the final moments, both conversion attempts being missed.