Toney was largely kept quiet throughout the 90 minutes but his effort midway through the second half – his 11th in as many league outings – proved decisive.
The victory was Brentford’s first in four outings and moved them within two points of the play-off places.
It was a fair result as the visitors created most of the openings, keeping Barnsley at bay.
Ilias Chair put Rangers ahead after 20 minutes and they seemed to be in control before Michael Smith’s 38th-minute equaliser – the striker’s first goal since February.
But two goals in first-half injury time proved decisive for the Rs.
Having twice hit the woodwork, Osayi-Samuel scored in fine style and Lyndon Dykes then thumped in a penalty after Dan Barlaser’s handball.
Freddie Ladapo pulled a goal back with six minutes remaining but Rangers held out for the win despite some uncomfortable moments in the final stages.
Ten-man Norwich survived a Stoke fightback to claim a 3-2 win at the bet365 Stadium and stay top of the Championship.
Bournemouth remain a point behind in second place after beating Nottingham Forest 2-0 at the Vitality Stadium.
Blackburn registered an emphatic 3-0 victory over 10-man Preston in the Lancashire derby at Deepdale.
Luton and Birmingham shared a 1-1 draw at Kenilworth Road, Matty Pearson levelling after Lukas Jutkiewicz had put the Blues ahead from the penalty spot after an Elliot Lee handball.
And promoted Wycombe have now lost just one of their last six league matches after a goalless draw with Huddersfield, who have won once in seven.
Additional reporting by PA.