Doncaster stretched their unbeaten run to six games in a vital top-five clash between two of the highest scorers in Division Three.
It was Doncaster's superior firepower that ultimately paid off but Mansfield never gave up the fight and were close to scoring more goals themselves.
Rovers emerged the better side after a scrappy start in which both sides cancelled each other out.
Teenage striker Chris Brown had a 14th minute header saved and Gregg Blundell missed a good chance when he lobbed wide with visiting keeper Kevin Pilkington stranded a minute later.
But it was the Stags who snatched the lead against the run of play with a well-taken goal in the 21st minute.
Lee Williamson latched onto a poor clearance and hit a curling pass to Liam Lawrence who slotted home a low shot in fine style from just inside the penalty area.
Rovers came roaring back with Brown twice going close to snatching an equaliser before Francis Tierney had a shot cleared off the line by Tony Vaughan.
Doncaster were rewarded for their persistence when Blundell levelled the scores with a neat finish in the 38th minute following good work by Michael McIndoe.
Blundell had a powerful shot saved just before the interval but Doncaster did not have long to wait to snatch the lead in the second half.
Tierney and McIndoe combined to set up midfielder Paul Green, who scored with a shot on the turn from close range in the 53rd minute.
It was all Doncaster at that stage and McIndoe made it 3-1 from the penalty spot in the 69th minute after David Artell had been penalised for hand ball.
Brown added a fourth when he rounded Pilkington to fire home after latching onto a bad mis-kick by the keeper.
But the Stags never gave up the fight and they pulled one back three minutes later when substitute Wayne Corden lobbed home after Andy Warrington had palmed out a cross under pressure from Isyeden Christie.
Mansfield went close twice more in the closing stages before Pilkington made a fine save to prevent Tierney adding a fifth in injury time.