Winger Dennis Tuffour was the Dons hero as he burst past several players on an incredible run in the last attack of the game before sending Craig Fawcett over between the posts.
It was an amazing comeback by Doncaster who trailed 26-17 with only a minute of normal time remaining after Swinton had staged a storming comeback of their own.
Doncaster opened up an early lead with tries from Fawcett and Brett Waller in the seventh and 28th minutes with Dave Scott improving both.
Paul Cooke landed a 33rd-minute drop goal to put Doncaster 13 points in front before determined Swinton battled back with a try from Craig Harvey four minutes later.
Scott raced through in the corner to make it 17-4 at the interval but Swinton showed tremendous spirit as they hit back to turn the tables on the hosts in the second half.
Darren Hawkyard touched down to put them back in the match before two tries from James Mendieka in the space of three minutes gave Swinton the lead.
Doncaster looked down and out when Rhys Williams grabbed another converted try for the visitors in the 73rd minute to put them nine points in front and heading for a deserved victory.
But the home side refused to lie down and powerful prop Mark Castle gave Doncaster a vital lifeline when he dived over with Scott converting in the 79th minute to narrow the gap to just three points.
It looked as if Doncaster had left their effort too late until Tuffour provided his flash of inspiration to put Fawcett through to break their opponents’ hearts.
Doncaster: Butterfield, Tuffour, Cowling, Dawson, Scott, Cooke, Fawcett, Castle, Emmett, Carbutt, Kelly, Spurr, Robinson. Substitutes: Kesik, Spiers, Waller, Waterman.
Swinton Lions: R Hawkyard, Williams, Mendieka, Nanyn, Penny, Harvey, Watson, Riley, Smith, Morrison, D Hawkyard, Sarsfield, Hulme. Substitutes: Barlow, Burke, Brown, Tahraqui.
Referee: D Sharpe (RFL)