The result confirmed Posh's relegation back to League One after just a season in the second tier, ending a tumultuous campaign for the London Road club.
However, Peterborough will be buoyed by the news that former Bristol City manager Gary Johnson will be appointed as new manager tomorrow, ending Gannon's three-month tenure at the helm.
After losing five games on the trot, the match had started in the perfect manner for the bottom-placed side with returning centre-back Ryan Bennett opening the scoring with a well-taken shot into the bottom-right corner in the fifth minute.
However, Barnsley hit back immediately through Iain Hume and continued to pepper the visitors' goal for the remainder of the first half.
The home side continued to heap pressure on Peterborough after the restart, yet it was the visitors who snatched the lead through Tommy Rowe's low drive.
But, like in the first half, the Tykes responded strongly and five minutes from time Hume jinked past goalkeeper James McKeown and placed the ball into an empty net to condemn Posh to the drop.
Barnsley boss Mark Robins handed Martin Devaney his first start since September, while the outgoing Gannon recalled record signing Bennett, who had missed the last nine games with an ankle problem.
And the former Grimsby centre-back's inclusion paid immediate dividends as he opened the scoring after just five minutes.
Green's lofted free-kick into the box bounced to Bennett, who showed the skill and poise of a striker to turn on a sixpence before lashing into the bottom-right corner from close range.
Two minutes later, the home side were level as Hume was allowed time by the dishevelled Peterborough defence to control a bobbling ball in the box, before finishing off the inside of the left-hand post.
As the half wore on Barnsley began to pepper the Peterborough goal, including forcing McKeown into a point-blank reaction save from Jon Macken's header in the 40th minute.
After the break, Barnsley continued to press the beleaguered Posh defence, yet it was the visitors who again took the lead.
Former Peterborough trainee Luke Steele had produced several fine saves to prevent substitute Craig Mackail-Smith but could do nothing to thwart Rowe's rifled effort into the bottom-left corner.
As the clock ran down it looked as if the 289 visiting supporters would have an away victory to remember, but Hume broke through and netted a well-deserved equaliser five minutes from time.