A text-book Stuart Dallas volley just before the hour clinched the points and ended the Millers’ dogged resistance.
Steve Evans’ men parked the bus and broke intelligently on the break to frustrate the Londoners, whose narrow win meant they did the double over the Yorkshire outfit.
Brentford could and should have won more emphatically but a string of near misses and desperate backs-to-the-wall defending ensured a nail-biting finale.
And the Bees had keeper David Button to thank for the points, with a brilliant fingertip save to deny Paul Green’s glancing header from a Scott Wooton cross.
Rotherham looked the more lively in the opening stages, only a well-timed James Tarkowski tackle denying Matt Derbyshire.
Danny Ward curled a shot just wide for Rotherham on 14 minutes, temporarily sparking the hosts into life in what was turning into a lacklustre opening half.
Brentford midfielder Jota forced Adam Collin into a block with his feet before Richard Smallwood squandered a gilt-edged chance to put the Millers ahead on the half hour.
A neat build up ended with him in acres of space but he got nothing on the ball, which rolled into the hands of relieved keeper Button.
Adam Pitchard twice went close before the break, floating a chip just over and then seeing a dipping free-kick clearing wall and left-hand post.
But the breakthrough came on 57 minutes when Jota’s blocked snapshot dropped for Dallas, who did well to get over the ball and drill it home past the despairing hand of Collin.
The stalemate over, Rotherham were forced to be more ambitious and Button had to be at his best to stop efforts from both Conor Newton and new boy Adam Hammill.
Bees’ top scorer Andre Gray should have extended the lead as he raced onto a long ball, outstripped Green and stayed on his feet only to see his shot blocked by Collin, who then did well to tip Jota’s rebound wide.
Pritchard slammed a 25-yard drive against the upright on 70 minutes and Jonathan Douglas saw his goal-bound drive blocked on the line by Kari Arnason as Brentford surged forward looking for the killer goal.
Bees midfielder Toumani Diagouraga earned a man-of-the-match award for mopping up every loose ball in front of the Bees defence, which sometimes looked uncharacteristically edgy.
But anything other than a win would have been harsh on a Brentford side, who stay fifth in the Championship and five points off the top with this much needed win.