David Cotterill's first league goal for Barnsley ended a run of four straight defeats, despite his side playing for almost an hour with 10 men.
Cotterill steered home from the edge of the box after good work down the left wing by Nathan Doyle.
But Doyle was sent off 13 minutes before the break for a late challenge on Lee Tomlin.
Emile Sinclair had two chances to equalise in the second half but Barnsley held on to win.
Keith Hill's Barnsley created the first opening inside two minutes as Matty Done's inswinging corner was headed wide by Jimmy McNulty.
Craig Davies then tried his luck from distance but Paul Jones showed solid handling.
Barnsley capped their promising start with the winner midway through the opening half when Cotterill took his chance well.
Darren Ferguson's men were given a timely boost just past the half hour when Doyle was shown a straight red card.
Posh sought to make their numerical advantage count before the break and Tomlin's dipping effort forced a strong save from David Button.
The home side still offered a threat going forward and could have doubled their lead just prior to half-time when Cotterill's free-kick was nodded wide by Davies from six yards.
And in the final action of the half Grant McCann had to be alert to head away Cotterill's searching corner.
Posh substitute Emile Sinclair went close with an 18-yard volley in the 69th minute which flashed narrowly wide and Button denied Little as he got a shot away from inside the area.
The visitors wasted a late chance to level when Sinclair nodded wide from Tyrone Barnett's flick-on.
Barnsley manager Keith Hill: "I was proud of the way the players stood up to the challenge after a series of results which have put us in the position we are in and were being dragged into.
"Today they have stood up perfectly. We are getting back to the way that I want football to be played by the players and received by the fans.
"It's too close to call that we are safe but the pressure on the bottom five is more severe than on ourselves, but we are not safe from a relegation battle."
Peterborough manager Darren Ferguson: "It was a totally inept performance after the performance in midweek.
"I've told the players that if there are many performances like that in the remaining games that it will make my decisions in the summer easy.
"This was a game that worried me a bit, I was concerned about the way we approached it after two big performances.
"I've also told them that they owe me a performance on Tuesday. Today was an opportunity to get 47 points and be safe. Today we had one or two half-chances late on."