James Coppinger put the visitors in front in the 11th minute before a 27th-minute penalty from Jason Scotland levelled the scores at the interval.
Two second-half strikes by Jordi Gomez in the 70th and 90th minutes gave Swansea a deserved victory before Richie Wellens was sent off.
"It was our best performance of the season," admitted Martinez.
"We didn't start well and were punished with that early goal but it was a real test of character and we showed a great reaction to come back so well and win the game."
Rovers manager Sean O'Driscoll praised Swansea's performance while questioning the role of the referee.
"I can't quite make out whether it was a difficult game for him or whether he over-reacted because he was certainly quick with the yellow cards," claimed O'Driscoll.
"Two of them mean a red so there is little to say about Wellens being sent off although his second booking was a little soft.
"I never saw the spitting incident and if you ask Richie he will say he never spat at anybody.
"On the other hand I am a little disappointed at cries of 'cheat' when James Coppinger was injured.
"The lad is now in hospital having a brain scan after suffering possible concussion.
"With regards to the football it was a fair result and Swansea are probably equipped better than most to come up a division and do well.
"You have to stamp some authority on the game right at the beginning but we didn't start very well despite scoring a goal.
"We ended up struggling to close them down. It was difficult for us as this is a hard place to come."
Swansea suffered a blow before the match when skipper Gary Monk failed a late fitness test on his back and his absence was crucial as Rovers took the lead.
A ball through the middle left the home defence exposed and Wellens was unmarked as he attempted to stab the loose ball home.
Swansea keeper Dorus De Vries blocked with his legs but the ball ran to Coppinger who forced it home from close range.
It took the Swans time to settle but they were handed the equaliser on a plate when Doncaster full-back James O'Connor needlessly pushed Alan Tate inside the area. Scotland easily dispatched the spot-kick to level the score.
There was drama in the final minute of the first half as Coppinger went down after a challenge which left him with a blow to the head.
The players gathered around and trouble flared between Wellens and Leon Britton and it was later alleged that the Rovers player had spat at Britton.
Coppinger was then stretchered off and taken to hospital with suspected concussion.
"I was very disappointed with Wellens when I heard of the incident with Leon Britton," added Martinez.
"It is not something you expect form a professional footballer."
In the second half Swansea began to take control with Mark Gower and Nathan Dyer causing all sorts of trouble down the flanks.
In the 63rd minute Scotland sent Gower through on goal but veteran keeper Neil Sullivan went down low to push behind for a corner.
But the home side deservedly went ahead seven minutes later and it was Scotland who fashioned the goal.
He laid the ball off perfectly for Gomez who met it first time to send it flashing into the net from a central position.
Wellens, who had been off the pace in the second half, received a second yellow card in the 84th minute after bringing down Gomez.
There was just time for the Swans to make full use of the extra man when the impressive Scotland set up Gomez for the Spaniard's second goal right on full-time.