Brian Howard, Dennis Souza and substitute Martin Devaney scored as the Tykes ended City's unbeaten record.
Howard broke the deadlock on 67 minutes when he cut inside and curled the ball into the bottom corner.
Five minutes later, Souza pounced to score after keeper Adriano Basso failed to hold Dominik Werling's free-kick.
Devaney sealed Barnsley's victory with a shot from the edge of the penalty area. Basso got a hand to the ball but was unable to keep it out of his net.
Barnsley manager Simon Davey:
"It was a faultless performance but it is only early days. But we have to make sure that we continue to do that and take it into Saturday's match.
"It was a great performance, from the way we defended, created chances as well as taken our chances when we needed to.
"Every week is a test and to go to Charlton, an ex-Premiership team with great
experience, but we're confident we can go and get a result anywhere.
"It is close to the best performance of the season, apart from spells against
Southampton and Stoke where we were in control, but it was probably our best
all-round performance where we dominated for 90 minutes."
Bristol City manager Gary Johnson:
"The run has come to an end because we didn't do our stuff on the pitch. We had two or three half chances early in the game and if we had been able to put those away it might have been a different story .
"At 2-0 we have thrown everyone forward and they have come and punished us on the break. We should have maybe made more of our earlier chances.
"They have a good record here, play good football and we were not match for
them over 90 minutes. They were two good goals but we needed to take our chances and we didn't do that.
"Credit to Barnsley they got on top, got their runners into the box and most
importantly they were clinical where it mattered."
Barnsley: Muller, Foster, Souza, Nyatanga, Werling, Campbell-Ryce (Devaney 81), De Silva, Howard, McCann (Togwell 87), Mostto (Christensen 76), Odejayi.
Subs Not Used: Colgan, Kozluk.
Booked: De Silva, Odejayi.
Goals: Howard 67, Souza 72, Devaney 88.
Bristol City: Basso, Orr, Fontaine (Vasko 73), Carey, McAllister, Murray (Sproule 72), Elliott (Skuse 76), Johnson, McIndoe, Byfield, Trundle.
Subs Not Used: Henderson, Brian Wilson.
Booked: Johnson, Fontaine.
Ref: Eddie Ilderton (Tyne & Wear).