The Millers also scored for the first time under Warnock through Matt Derbyshire after good work by Lee Frecklington.
Brentford levelled when Alan Judge scored on the follow-up after his penalty was saved by Lee Camp.
But Rotherham secured a first win in eight games through Danny Ward.
Ward's 71st-minute goal following a corner means the Millers, who occupy the final relegation place, are now within one victory of MK Dons, who lost a thrilling game against Blackburn Rovers.
The Bees had the better of things early on with home 'keeper Camp making a superb save to deny Judge.
Media playback is not supported on this device
But Warnock's men, playing in a predictably physical style, looked like they would be ahead at the break thanks to Derbyshire, only for referee Mark Brown to penalise Frecklington when he appeared to win the ball from Sergi Canos.
The Millers managed to block out the sense of injustice following the penalty equaliser, and Greg Halford went close and Ward saw a shot tipped on to the bar before Ward's close-range winner.
Rotherham boss Neil Warnock:
"It's nice to get the win, I said to the lads 'how does it feel, that's what you have to go through'.
"I really enjoyed it. They gave me absolutely everything, that's the Championship, you have to do that as a minimum.
"We have got some tough games coming up but they will be tough for them. It helps to get three points, just to get us back in the mix. They couldn't have given any more, we might be a bit limited, but we're not lacking in the heart stakes.
"I love the Championship because it is the way it is. I am usually going for promotion and you always come unstuck against teams at the bottom. I think we can be a coupon-buster in the next few weeks."
Brentford manager Dean Smith:
"What went wrong was we got involved in a tear up and that is not our game. Our game is about playing football, passing and moving it.
"We did it at times in the first half without really creating too many opportunities. In the second half, we have given opportunity for the official to give too many free-kicks.
"I thought we had a very harsh penalty given in our favour. I thought their lad has touched the ball, at the time I thought it was a penalty but I have seen it back. I want to know why the second half was managed and officiating in a different way to the first half.
"It got their tails up, then we got involved in a bit of a scrap and then it became a bit of a 50/50. We probably deserved to lose in the end. Both goals were very poor goals, but then we had a great chance to equalise afterwards."
Match ends, Rotherham United 2, Brentford 1.
Second Half ends, Rotherham United 2, Brentford 1.
Foul by Lasse Vibe (Brentford).
Kirk Broadfoot (Rotherham United) wins a free kick in the defensive half.
Attempt saved. Lasse Vibe (Brentford) right footed shot from outside the box is saved in the centre of the goal. Assisted by Philipp Hofmann.
Attempt missed. Lasse Vibe (Brentford) header from the centre of the box is too high. Assisted by Konstantin Kerschbaumer with a cross.
Jake Bidwell (Brentford) is shown the yellow card.
Foul by Jake Bidwell (Brentford).
Greg Halford (Rotherham United) wins a free kick on the right wing.
Hand ball by Konstantin Kerschbaumer (Brentford).
Foul by Philipp Hofmann (Brentford).
Kirk Broadfoot (Rotherham United) wins a free kick in the defensive half.
Substitution, Brentford. Lasse Vibe replaces Sergi Canos.
Attempt saved. Kirk Broadfoot (Rotherham United) header from the centre of the box is saved in the top centre of the goal. Assisted by Richard Smallwood.
Substitution, Rotherham United. Paul Green replaces Lee Frecklington.
Foul by Jack O'Connell (Brentford).
Danny Ward (Rotherham United) wins a free kick in the attacking half.
Corner,  Brentford. Conceded by Grant Ward.
Attempt saved. Danny Ward (Rotherham United) left footed shot from a difficult angle on the left is saved in the top left corner. Assisted by Richard Wood with a headed pass.
Foul by Jake Bidwell (Brentford).
Greg Halford (Rotherham United) wins a free kick on the right wing.
Substitution, Brentford. Konstantin Kerschbaumer replaces Josh McEachran.
Foul by Jack O'Connell (Brentford).
Matt Derbyshire (Rotherham United) wins a free kick in the defensive half.
Substitution, Rotherham United. Grant Ward replaces Jerome Thomas.
Jake Bidwell (Brentford) wins a free kick in the defensive half.
Foul by Greg Halford (Rotherham United).
Foul by Jack O'Connell (Brentford).
Danny Ward (Rotherham United) wins a free kick in the attacking half.
Attempt blocked. Philipp Hofmann (Brentford) right footed shot from very close range is blocked. Assisted by John Swift.
Attempt blocked. John Swift (Brentford) right footed shot from the centre of the box is blocked.
Goal!  Rotherham United 2, Brentford 1. Danny Ward (Rotherham United) left footed shot from the centre of the box to the bottom right corner following a corner.
Corner,  Rotherham United. Conceded by David Button.
Attempt saved. Danny Ward (Rotherham United) left footed shot from the centre of the box is saved in the top centre of the goal.
Foul by Ryan Woods (Brentford).
Joe Mattock (Rotherham United) wins a free kick in the defensive half.
Delay over. They are ready to continue.
Delay in match Josh McEachran (Brentford) because of an injury.
Attempt missed. Alan Judge (Brentford) right footed shot from outside the box is too high. Assisted by Sergi Canos.
Substitution, Brentford. Philipp Hofmann replaces Marco Djuricin.
Rotherham United earned their first win in four attempts under new manager Neil Warnock to move to within three points of Championship safety.