The defeat has left Rovers bottom of the table on 32 points with just three games remaining.
Doncaster had led visiting Pompey 2-0 and then 3-2 at the Keepmoat Stadium. However, late strikes from Dave Kitson and Marko Futacs sealed the home side's fate.
Had Doncaster have claimed maximum points, then Portsmouth would have been relegated. As it is, Pompey require maximum points from their remaining matches to stand any chance of survival.
Donny had been in the second tier since winning promotion from League One in 2008.