Ivan Toney’s second-half header gave Brentford yet another west London derby victory.
Vitaly Janelt’s first goal for the Bees put them ahead somewhat against the run of play.
Rangers deservedly levelled through Lyndon Dykes’ first goal in open play since his summer move to W12.
But striker Toney’s 12th goal of the season made it eight wins from 10 matches for Brentford against their neighbours, who ended the match with 10 men after Todd Kane was sent off with seven minutes remaining.
The home side were arguably fortunate not to have been reduced to 10 men in the first half, when Mads Sørensen escaped with only a yellow card after shoving over Dykes, who would have been through on goal.
Janelt opened the scoring on the quarter-hour mark.
Rico Henry laid the ball back to the German, who fired into the bottom corner from near the edge of the penalty area.
Rangers hit back in fine style, with Bright Osayi-Samuel sprinting down the right and delivering the perfect cross for Dykes to slide in and score from close range.
But Toney restored the Bees’ lead by brushing off a woefully weak challenge from Niko Hamalainen to nod home Emiliano Marcondes’ right-wing free-kick.
Kane picked up a second yellow card following a rash challenge on Marcus Forss.
Brentford: Raya; Dalsgaard (Jansson 45), Jansson, Pinnock, Henry, Janelt, Dasilva, Marcondes (Jensen 45); Mbeumo (Ghoddos 7), Toney; Fosu-Henry.
Subs not used: Daniels, Thompson, Canos, Forss, Stevens, Pressley.
QPR: Dieng; Kane, Dickie, Barbet, Hamalainen (Bonne 86); Ball (Adomah 79), Carroll, Chair; Osayi-Samuel, Dykes, Willock (Thomas 74).
Subs not used: Kelly, Kakay, Masterson, Bettache, Kelman, Wallace.