Posh’s win boosts their survival hopes while leaving Barnsley teetering on the brink of relegation.
Barnsley started brightly, going close to scoring in the opening minute. Carlton Morris laid the ball off to Domingos Quina, whose effort from the edge of the area came back off the bar.
Romal Palmer also went close, controlling a low cross from Remy Vita before firing in a shot which was saved by David Cornell.
Morris then tested Cornell with a looping header after meeting a free-kick from Amine Bassi, with the keeper doing well to tip the ball over the bar.
Peterborough’s Joe Ward broke free on the right-hand side of the area and fired a low shot on target but keeper Jack Walton was equal to it, saving with his legs.
Walton then made a comfortable save from a Harrison Burrows low shot.
Marriott put Posh ahead in the 25th minute with a clinical finish into the roof of the net after receiving a through ball from Sammie Szmodics.
Barnsley striker Cauley Woodrow was introduced as a substitute when play resumed after the break.
Woodrow was soon involved in the action, slipping the ball through to Callum Styles who was challenged inside the area, with the ball falling to Morris whose shot was saved by Cornell at his near post.
Szmodics threatened to find a way through at the other end with Walton diving bravely at his feet to claim the ball.
As Barnsley looked to equalise, Bassi’s low free-kick picked out Woodrow inside the area but his shot was straight at Cornell.
Posh took advantage as Kent increased their lead on 75 minutes, meeting a Burrows corner with a well directed header.
Barnsley had a great chance to reduce the deficit when Morris looked certain to score but, with Cornell off his line, the player saw his shot deflected over by a defender.
Peterborough substitute Kwame Poku fired in a low shot which hit the side netting in the closing minutes.
The defeat leaves Barnsley 11 points adrift of fourth-from-bottom Reading and with a maximum of 12 points still available.
A chorus of boos from Barnsley fans greeted the final whistle with the South Yorkshire club all but certain to be playing in League One next season.