The home side dominated much of the first half without testing Bees goalkeeper Richard Lee.
Brentford substitute Sam Saunders capitalised on a 79th-minute mistake by Bobby Reid to cut in from the left and drill a low 20-yard shot that deflected off a defender to wrong-foot City keeper Elliot Parish.
The outcome was settled after 86 minute when City's defence failed to deal with a Saunders corner from the left, leaving Clayton Donaldson with a simple tap in from inside the six-yard box.
"I didn't realise how strong the wind was standing in the dug-out, but it put us on the back foot and Bristol started the game very well," Rosler said.
"We had to weather a storm and when you do that without your goalkeeper making a lot of saves it is a tribute to the hard work of the midfield as well as the back line.
"Our football started to improve late in the first half and that continued after half-time.
"In the end it was a good night for the players and our travelling supporters.
"I thought the Bristol City fans were very good in sticking behind their team even when they went two goals down.
"I wish we had more of that."