Rovers' club record signing Sharp, a £1.1million capture from Sheffield United in July, blasted home his first goal of the season from the spot after Jamie McAllister's 89th-minute foul on Doncaster substitute James Coppinger.
It was a cruel blow for City, who had taken the lead early in the second half when Damion Stewart headed home McAllister's cross, in Keith Millen's first game in charge as permanent manager.
City wasted little time in appointing Millen as Steve Coppell's successor after the former Crystal Palace and Reading boss announced his decision to quit football management on Thursday and the Robins responded admirably after successive defeats had made for a miserable start to their season.
But despite playing second fiddle for most of the second half, Sean O'Driscoll's Rovers were rewarded for a spirited finish.
Tottenham teenager Ryan Mason, who signed on loan this week for a month, was among six changes to Rovers' starting line-up, with Shelton Martis, Simon Gillett, Martin Woods, Sharp and skipper Brian Stock all returning.
David James was recalled by Millen for City in place of Dean Gerken, while Stewart and Marvin Elliott were also reinstated.
James held an early shot from Gillett and after Sharp had fired over the crossbar was at his acrobatic best to tip George Friend's near-post effort around the post as Rovers created the better first-half chances.
Doncaster goalkeeper Neil Sullivan comfortably dealt with City's first strike on goal, an angled drive from Albert Adomah in the 24th minute as Rovers continued to threaten.
Sharp and Gillett had further shots blocked and Mason curled a 25-yard effort just wide for the home side, but City went close to snatching the lead just before the break when Stewart headed Jamie McAllister's free-kick over the crossbar.
The visitors took less than two minutes to break the deadlock after the half-time break.
McAllister again supplied the cross, this time from the right, and Stewart swooped to head home into the bottom corner.
Adomah dragged another shot wide when well placed soon after as City looked to build on their lead and David Clarkson forced Sullivan into a fine save with an angled drive just after the hour-mark.
Rovers skipper Stock, on international duty for Wales in midweek, was replaced by James Coppinger, while Thomas was handed his first Doncaster appearance when Martis was forced off injured in the 74th minute.
Dean Shiels was off target with a left-footed shot from the left side of the area and Sharp had another effort blocked by Liam Fontaine.
But Rovers were rewarded in the closing stages when Coppinger was upended by McAllister in the area and Sharp stepped forward to slam home his spot kick.
Doncaster almost snatched all three points at the death, but substitute Steve Brooker blazed over from six yards.