Their 3-2 victory at the City Ground was a tense affair, but nerves were settled when Julian Bennett put them ahead after 12 minutes.
Kris Commons and Lewis McGugan also netted for Forest, who kept the Glovers at bay despite Jaime Peters and Andy Kirk scoring to ensure a nervous final few moments.
Forest's success meant despair for Doncaster, who had started the day in second place but must now ride their luck in the end-of-season play-offs.
They lost 2-1 at Cheltenham, and will take on Southend United in the play-offs. Carlisle and Leeds will meet in the other play-off semi-final.
In League Two, Stockport will face Wycombe while Rochdale face Darlington.