The 23-year-old midfielder scored either side of a Billy Sharp penalty at the Den on Tuesday night to put the Lions on the way to their first win in four games and help move them clear of danger.
He opened the scoring in the first half from the spot after John Marquis was fouled and then netted the winner in the latter stages of the half by shooting underneath Carl Ikeme.
Substitute Darius Henderson gave Kenny Jackett's side a two-goal cushion late on when he headed home Hamer Bouazza's free-kick before Sharp's second of the game, also a header, set up a nervy finish.
For Doncaster, who were briefly level at 1-1 thanks to Sharp's spot-kick, it was another poor showing, though they may claim they deserved a point after a frantic finish.
And whilst Rovers may be able to call on the individual talent of the likes of El-Hadji Diouf, Herold Goulon, Marc-Antoine Fortune, Herita Ilunga and Giles Barnes, they look anything but a team, with only one win in their last nine league games.
With no wins in their previous three games, Millwall will have seen this encounter as an opportunity to move clear of the drop zone and they made the better start, almost going ahead inside the first 10 minutes.
A free-kick fell kindly to Trotter at the far post, but his shot was superbly tipped over by on-loan Rovers keeper Ikeme.
That attacking intent from the hosts continued and they were rewarded with a 25th-minute opener.
Marquis embarked on a driving run into the penalty area and just as it looked as if he had lost control of the ball, he was clipped by Rovers midfielder Brian Stock, with referee Andy D'Urso pointing to the spot.
And Trotter made amends for his earlier miss by stroking the penalty home.
Doncaster's response was admirable and they were almost level shortly after but defender Jack Smith's heroics on the line kept out Goulon's header.
They did get themselves back on even terms five minutes before the break when Sharp converted from the spot after he was pushed over by Scott Barron.
That joy for Dean Saunders' men was short-lived, though, as the hosts needed just two minutes to restore their advantage and it was that man Trotter again.
He picked up the ball 35 yards out, advanced towards the area and after a one-two with Smith he shot under the despairing dive of Ikeme.
Millwall came out after the break and quickly asserted their authority and they were within inches of earning a two-goal cushion when some shoddy Doncaster defending allowed Shane Lowry to steal in at the far post, but his sliding effort smashed into the crossbar.
They did eventually get the two-goal cushion when Henderson climbed highest to head home Bouazza's cross with six minutes remaining.
But there was to be a nervy finish as Rovers made it interesting when Sharp grabbed his second of the night after good work from Kyle Bennett.
Millwall saw it through, though, to leave Doncaster contemplating a long journey home and an even longer winter on the horizon.