The Robins climbed off the foot of the table thanks to victory at Ashton Gate just three points behind their opponents who are now fourth from bottom, two points off the relegation zone.
Jon Stead struck in either half, Liam Fontaine hit his first goal since April 2010 and Lewin Nyatanga and Steven Davis also got in on the act to hand the Robins their first win in three matches.
The visitors responded with Chris O'Grady's first goal since joining on loan from Sheffield Wednesday, and further strikes from substitutes Tomasz Cywka and Jason Scotland.
Flitcroft admitted he was shocked by the manner the Tykes' good form had come to such an abrupt halt. He said: "I knew our great run had to end somewhere, but the way it ended surprised me. The goals we conceded were very poor.
"We couldn't defend set-pieces and it is back to the training ground in that respect. And we couldn't handle City's strikers. Jon Stead and Steven Davies out-muscled us for most of the game. But we will dust ourselves down and come again.
"I have an honest bunch of players and they still showed great spirit after going 5-1 down so I'm sure this will just prove an off-day."
City head coach Sean O'Driscoll, who turned down the chance to become Barnsley boss before his appointment at Ashton Gate, said: "The game was probably more open than either side wanted.
"Credit to Barnsley because they certainly didn't come to shut up shop. They had a lot of chances, but so did we and it made for an exciting game. I said after our defeats at Cardiff and Crystal Palace that the spirit had not been knocked out of us and this display proved it.
"We still have a long way to go, but if the players can maintain that level of commitment we will give ourselves a chance. Our home form is good and we have improved in away games without getting any reward as yet."