Goals from Conor Chaplin and Carlton Morris kept the Tykes in the play-off race, whilst winning their game in hand could move them just four points away from sixth place.
The Bees missed the chance to go top of the table against a side who beat them at home towards the end of last season.
This game was just their second defeat at the Brentford Community Stadium, with Preston North End also beating them at their new home back in October.
For the hosts, Charlie Goode returned to the squad on the bench, whilst Thomas Frank made two changes to the starting eleven from their win against Reading, with Saman Ghoddos and Sergi Canos coming in for Mathias Jensen and Tariqe Fosu-Henry.
For Barnsley, Michael Sollbauer, Romal Palmer, Daryl Dike and Carlton Morris came in to the team for Toby Sibbick, Herbie Kane, Cauley Woodrow and Victor Adeboyejo. Morris was signed on a permanent deal from Premier League side Norwich City in January.
Story of the match
Neither side created any opportunities in the opening ten minutes, with the away side edging it and looking the more likely.
After 12 minutes, a scramble in the box from a Barnsley corner fell to Callum Styles on the edge of the box, but he did not connect with the ball as he would have liked, providing an easy catch for David Raya.
On the thirteenth minute of the game, Barnsley took the lead. Callum Brittain cut inside onto his left foot and whipped in a cross from the right-hand side, he found Chaplin who was free at the far side and finished to give his side the lead, Raya got a touch on it but could not keep it out from such a short distance.
Just a couple of minutes later, Josh Dasilva was presented with a great chance on the edge of the box but dragged his shot wide, he really should have done better and equalised.
Mid way through the first period, a great ball in from the left from Morris was brilliantly intercepted by Mads Bech Sorensen, who had to get there to deny an opportunity for the Tykes to double their advantage.
On the half hour mark, Bryan Mbeumo made a great run and put a dangerous first-time ball into the box, but it was headed away from Michal Helik for a Brentford corner, which was subsequently gathered by Bradley Collins.
With ten minutes to go in the first half, Brittain put in another good ball in from the right for the visitors, he found Morris, but his looping header was saved comfortably by Raya.
After 37 minutes, Ivan Toney found Mbeumo down the right flank with Canos in acres of space on the left side, although the Frenchman took too many touches and was eventually fouled. From the resulting free kick, Ethan Pinnock had two efforts on target blocked by Dike.
The last action of the first period saw Canos find Ghoddos from a quick free kick, it was another great chance from the edge of the box for the hosts, but his strike was too close to the goalkeeper.
In the first minute of the second half, the Tykes doubled their lead.
Dike put a powerful ball into the box which Pinnock got stuck between his feet before the ball fell straight into the path of Morris, who struck the ball off the inside of the post and in.
On 58 minutes, substitute Dominik Frieser’s ball in the box was touched into his own net by Pinnock, who was relieved to see the offside flag raised.
Then just a minute later, two more substitutes combined when Woodrow got in front of his man and found Adeboyejo, whose great effort on the half volley from the edge of the box went just wide.
On the hour mark, the Bees had a strong penalty shout turned down by the referee, Toney appeared to be pushed in box from a free kick, but no penalty was given.
An effort from Canos five minutes later was spilled by Collins and did not quite fall nicely enough for substitute Fosu-Henry to have a clear effort on goal.
Barnsley saw the game out brilliantly and denied the hosts any clear cut chances in the latter stages of the game, to take all three points.
Barnsley's press worked well throughout the game, they were compact and almost always first to loose balls, their determination made them deserved winners and playing like that will give them every chance.
Going forward, there was a clear plan from Valerien Ismael to utilise the wings, which they did throughout and helped them to create enough chances to beat very tough opponents.
A win in their game in hand could see them go just four points off the play-off places, playing like this will always keep themselves in any game and should give them a genuine chance this campaign.
Frank will be frustrated at the amount of chances his side missed, in games like this, getting one goal back could have easily sparked a comeback from the hosts but they were unable to get on the scoresheet.
Chances from the likes of Ghoddos and Dasilva should have been converted, but as well as that, they were often second to loose balls and out worked by the visitors.
Man of the match
Romal Palmer was one of many outstanding performers for Barnsley on the day, he may not have stolen the headlines but his work rate and reading of the game meant he was vital to the way Barnsley played.
He had an important role in a midfield who needed to find the right balance with their compact pressing and at 22 years of age, did so excellently.