A top-class display by Knights’ pack in the first half set up their 16th win in 19 matches and earned them a potentially precious maximum five-point haul.
Doncaster’s victory guaranteed that they will be involved in a final day shoot-out for the title on April 2 with Ealing Trailfinders and, in all likelihood, the Pirates.
Knights top the table with 72 points and finish their league campaign with a trip to second bottom Nottingham.
Ealing, second on 70 points, have two league games left to play.
Pirates, third with 64 points, have three more games remaining including a huge clash at Ealing.
Two tries by hooker George Edgson on 13 and 40 minutes and scores from second row John Kelly and No 8 Thom Smith in the 27th and the 36th minutes, and a conversion by fly half Sam Olver, supplied the control that Doncaster needed in such an important contest.
All four tries were the result of driving mauls from line-outs, and the last two by Smith and Edgson, were delivered when Pirates were punished for their indiscipline, reducing them to 13 men following rapid yellow cards on 34 and 35 minutes.
In the absence of forwards Antonio Kiri Kiri and Jack Andrew, Doncaster were ruthless, taking advantage of their opponents’ weakness by scoring 12 points, putting them ahead 22-7 at the interval.
However, Pirates recovered strongly in the second half and threatened to spoil the Knights’ unbeaten record at home.
A penalty and then a try by second row Josh Caulfield in the 63rd cut Doncaster’s lead to 22-15.
With the Pirates attacking and having plenty of ball, a Cornish victory gradually became possible.
But in a tense climax, on three occasions, Doncaster survived thanks to solid defence and errors by the Pirates as they raided the Knights’ line.
There was relief as the referee reversed a penalty and penalised Pirates instead. A few minutes later as their line was being assaulted again, Pirates knocked on.
And then, dramatically, in a 5m scrum in front of the Doncaster posts in added time, the Cornish pack gave away yet another penalty just when they had the opportunity to score followed by a simple conversion that would have earned a draw.
“I must give a lot of credit to our pack who were brilliant, particularly in the first half,” said Knights head coach Steve Boden.
“We also kicked well and this was one of the best performances of this campaign.
“Unfortunately, we couldn’t turn the screw in the second half, Pirates responded and made us fight to the end, but I’m happy.”
Knights: McBryde, Evans, Margetts (Edwards 57), Best, Holden (Davey 66), Olver, Green, Davidson (Wrafter 74), Edgson (Roberts 57), Foster (Connolly 56), Kelly (Davies 74), Murphy (Peters 73), Hudson, Graham, Smith (Volpi 67).
Pirates: Penny, Sirker, Wyatt, Tucker, Cant (Wedlake 56), Robson (Elderkin 57), Kessell (Walker 43), Channon (Cowan-Dickie 40), Petch (Rodman 73), Caulfield, Cutmore (Teague 67), Bolwell, Kiri Kiri (Gibson 67), Duncan.
Referee: M Hudson (RFU).