Brooker: Left it late again
The Posh, of League One, took a deserved lead in the 17th minute through George Boyd before defender Louis Carey headed home an equaliser eight minutes into the second half.
But Brooker, who netted in injury time in the 1-0 victory at Blackpool on the opening day of the Championship season on Saturday, came up trumps again with five minutes left at Ashton Gate.
Peterborough, beaten 1-0 at Southend in their League One opener on Saturday, created several opportunities in the opening 15 minutes.
Aaron Mclean, who has committed his future to the club following a summer of uncertainty, fired over the crossbar before Charlie Lee forced Robins goalkeeper Chris Weale into a smart save.
Michael McIndoe failed to find the target from 30 yards moments later for the hosts before Posh took the lead, Boyd drilling into the bottom corner from 12 yards.
There was then a lengthy delay in the 34th minute after City defender Christian Ribeiro appeared to catch his studs in the turf and was stretched off with a suspected broken bone in his leg.
It seemed to revitalise the Robins as they nearly equalised but Posh goalkeeper Joe Lewis was on hand to keep out Ivan Sproule's 20-yard effort.
The home side were back on level terms early in the second half. Jamie McAllister swung over a corner and Carey was on hand to head past Lewis.
Parity was nearly shortlived as Mclean looked set to restore Peterborough's lead, only for him to be denied by a fine save from Weale from 12 yards and the goalkeeper, also foiled Boyd moments later.
After Mclean headed another opportunity over, Posh were indebted to Lewis for keeping them on terms as the youngster pulled off an excellent save to keep out McIndoe's 18-yard drive.
But Brooker struck at the death again, heading home from close range to send the Robins through.