Afterwards, manager Daniel Stendel saluted a terrific all-round performance by his team.
“I’m delighted for the players because they gave everything and deserved the reward of three points,” he said. “We probably should have scored more goals, but I’m not going to complain after a performance like that.
“That result now sets us up nicely for the weekend game.”
The Reds opened impressively at Oakwell, with Cameron McGeehan seeing a smart effort well saved by Posh goalkeeper Conor O’Malley.
The visitors responded when Marcus Maddison drove a shot narrowly over the top.
The Reds took the lead in the 24th minute when Dimitri Cavare crossed in low for Alex Mowatt to tap home from close range.
Cauley Woodrow almost doubled the lead just before the break when he directed a header inches wide, but he made no mistake four minutes after the restart when he lashed home from the edge of the box.
Barnsley: Davies, Cavare, Pinnock, Linday, Pinillos, Dougall (Adeboyejo, 87), Mowatt, McGeehan, Potts (Brown, 74), Bahre (Thiam, 78), Woodrow. Unused substitutes: Greatorex, Jackson, Hedges, Moncur.
Peterborough United: O’Malley, Naismith (Lyon, 69), Daniel (Dembele, 56), Bennett, Tafazolli, Woodyard, Ward, O’Hara, Maddison, Godden (Cummings, 57), Toney. Unused substitutes: Chapman, Cooper, Reed, Stevens.
Referee: Carl Boyeson (East Yorkshire).