It was the Millers' first win since New Year's Day - a run stretching back nine matches - and ensured they stayed in touch with the teams above them despite remaining in the bottom three.
Two goals from Semi Ajayi sandwiched Ryan Williams' effort to end Rotherham's run of five draws on the bounce.
Amari'i Bell and Charlie Mulgrew replied for Rovers but their winless streak now stands at six.
Rotherham flew out of the blocks and were ahead after just 96 seconds when Ajayi powered in Will Vaulks' long throw into the bottom corner.
The pressure was kept up by the Millers and Vaulks came close himself with a dragged effort.
Jack Rodwell had the visitors' first effort on target but his overhead kick was straight at goalkeeper Marek Rodak.
Bell then had a tricky run into the box stopped by fellow full-back Billy Jones as Rotherham saw off Blackburn pressure at the end of the first half.
Blackburn made an attacking change at the break, with Joe Rothwell brought on for the second half.
Mulgrew tried to take advantage of the windy conditions with an in-swinging corner which almost crept over the line.
And it was the Scot's delivery which led to Blackburn's leveller after 51 minutes. Rotherham failed to clear the initial ball in and Bell was on hand to hook into the net.
Rotherham responded swiftly and were back in front after 57 minutes when half-time substitute Williams nipped in ahead of Rovers goalkeeper David Raya to prod the ball in from Michael Smith's knockdown.
Blackburn dangerman Bradley Dack carved out a chance for himself from Elliott Bennett's pass but, after creating space, he lashed his effort wide.
Michael Ihiekwe then denied Rothwell a shot on goal with a strong challenge.
The chances kept coming for the away side but Danny Graham could only find the side netting after Adam Armstrong's direct run and Mulgrew then fired straight at Rodak from a decent free-kick position.
Rothwell came even closer with an effort from 25 yards which had Rodak scrambling.
After conceding deep into stoppage time in the previous home game against Sheffield Wednesday, Rotherham needed another goal to settle the nerves and it came in the 83rd minute again through Ajayi.
The Nigeria international towered above the Blackburn defence to thunder a header into the top corner from Vaulks' cross.
Mulgrew converted a penalty in the third minute of added on time, when Billy Jones hauled back Graham after Dack's shot had cannoned off the post, but Rotherham clung on for a vital win.