Youngster Callum Styles’ first career goal put the visitors in front just before the break then, after the promotion-chasing hosts levelled, Oduor also netted his first in professional football.
The Reds have finished outside the relegation zone, having been nine points adrift in February and five earlier in the week, but must wait for Wigan Athletic’s 12-point deduction to be confirmed as the Latics have appealed.
Gerhard Struber made no changes to the side that started the win over Nottingham Forest three days earlier, while Elliot Simoes returned to the bench after injury.
Brentford’s Emiliano Marcondes had the first shot after just three minutes but his low long-range effort was wide then, midway through the first half, Mads Andersen headed an Alex Mowatt free-kick over the bar before Kilian Ludewig could get no power on a header from a Marcel Ritzmaier cross.
The first big chance went to the shots as Ollie Watkins found Said Benrahma 12 yards out but his powerful shot was well-saved by Jack Walton who got down to his right.
Barnsley thought their former centre-back Ethan Pinnock had handled in his box. But they soon stopped shouting at the referee and started celebrating as a right-wing cross fell to Styles on the left of the area and he smashed home with a low shot ten yards out. Walton made an outstanding save just before the break, pushing a powerful ten-yard effort from Bryan Mbuemo onto the left post after the Brentford forward met a low left-wing Rico Henry cross at the back post.
Barnsley had a fine chance to make it 2-0 five minutes after the break but Luke Thomas, in a three on two break, took too long before playing in Jacob Brown on the right and his shot was blocked. The Reds then thought another penalty should have been given against Pinnock for a foul on Ritzmaier while, at the other end, Mbuemo headed a free-kick over the bar.
Brentford’s Josh Dasilva levelled with a superb curling shot into the top left corner from the edge of the box after 75 minutes. The hosts were then on top and top-scorer Ollie Watkins should have put them ahead but missed the ball from a few yards out at the back post from a low left-wing cross.
Styles forced goalkeeper David Raya into a save with a low 25-yard shot. The winner came at the start of injury-time when two substitutes combined as Patrick Schmidt crossed and Oduor tapped in from three yards out.