Doncaster had to battle all the way for victory against a Gillingham side that looked any thing but relegation candidates.
Rovers rocked the visitors with an early goal in each half, but the Gills never gave up battling and the home side had to endure some anxious moments when they pulled one back following a corner.
Doncaster made a flying start with a goal in the fourth minute after Gillingham's static defence had been caught out by a clever through ball from Richie Wellens.
James Coppinger beat the offside trap and showed the defence a clean pair of heels as he raced through to round keeper Simon Royce before slotting home a low shot.
There was a scare for Doncaster in the 13minuite when the hard-working Delroy Facey charged onto a through ball from Kevin Maher and unleashed a fierce angled drive that was tipped away at the near post by keeper Neil Sullivan.
But it was virtually all Doncaster for the rest of the half, although they were unable to make their pressure count.
Paul Heffernan volleyed into the side-netting following a 23rd minute free-kick and substitute Sean McDaid had a cracking left-foot shot tipped over the bar by Royce four minutes later.
Brian Stock hit the post from 25 yards in the 28th minute and the ball rolled agonisingly across the face of goal before being cleared to safety.
Visiting skipper Andrew Crofts headed over the crossbar in an isolated attack in the 32nd minute, before Wellens had Royce at full-stretch to save a thumping volley from the edge of the box in the 42nd minute.
Stock missed a great chance when he fired over a minute later, but Heffernan made no mistake from the penalty spot after Adam Bygrave handled two minutes after the interval.
Bygrave committed another blunder three minutes later when he gave the ball away but Royce came to the rescue to parry Heffeman's full-blooded shot.
Crofts pulled one back out of the blue in the 56th minute when he headed home after Sullivan had fumbled a corner kick.
It lead to a tense finale, but Doncaster always looked likelier to add to their score and Gillingham were fortunate when a shot from Heffernan cannoned off Royce with McDaid's follow up effort being cleared off the line.