It was a clash between the two form teams in the Championship but Rovers deservedly came out on top despite City battling all the way.
The home side played with tremendous confidence passing the ball about in a slick fashion at the start before defending tenaciously when they had to in the closing stages.
City showed tremendous resolution themselves as they tried to battle their way back into the match but they were unable to snatch the goal that would have extended their run.
Heffernan's fourth-minute strike was a sweet moment for the Irishman, who joined Doncaster from Bristol City three-and-a-half years ago.
It came following an excellent move started by defender Sam Hird and Martin Woods. James Coppinger carried it on to feed Heffernan who hammered home his sixth goal of the season from close range.
It was the second successive match in which Heffernan had proved the match-winner and continued a remarkable transformation for Doncaster, who were bottom of the table at Christmas.
Liam Fontaine twice went close with headers from corners when City tried to hit back, but visiting keeper Adriano Basso had to move smartly to save from Matt Mills in the 27th minute.
Home keeper Neil Sullivan produced a reflex save to keep out a shot from Gavin Williams in the 36th minute before Basso produced an acrobatic save at full-stretch to tip a shot from Woods round the post three minutes later.
Doncaster continued to create chances at the start of the second half with Mills heading just wide in the 51st minute before John Spicer had a 58th-minute shot blocked.
Basso did well to save a fierce 20-yarder from James O'Connor in the 82nd minute but City finished the game strongly and it was all "hands to the pump" in the Rovers defence.
Substitute Izzy Iriekpen had a snapshot save in the 83rd minute before former Rover Michael McIndoe hammered a good chance wide three minutes from time to sum up the night for City who lost for the first time since before Christmas.