Sean Scannell headed a stoppage-time winner to clinch Crystal Palace their first win in four matches as Barnsley crashed to a fourth successive Championship defeat.
Scannell headed home Kagisho Dikgacoi’s deep cross in the 92nd minute to settle a dire contest and snatch three points the London side barely deserved.
Palace had drawn their last three games and eight of their previous 12, while Barnsley have now taken only two points from the last 21 available and could yet face a nerve-jangling relegation battle.
Midfield trio Scannell, Darren Ambrose and Dikgacoi returned for Palace, while Barnsley also made three changes.
Goalkeeper David Button, drafted in on an emergency loan, made his Tykes debut due to injuries to Luke Steele and David Preece, Stephen Dawson returned to midfield and veteran striker Andy Gray was recalled.
Palace defender Paddy McCarthy and Barnsley striker Craig Davies traded long-range thunderbolts in the opening 10 minutes, but both defences were well on top during the early exchanges.
The visitors’ back-four restricted Palace to another shot from outside the penalty area that flew over the crossbar in the 22nd minute, this time from Sean Scannell, and Barnsley mustered a similar effort via striker Frank Nouble, on loan from West Ham.
Palace’s Julian Speroni was the first goalkeeper called into action when he held Matty Done’s thumping 30-yard drive in the 31st minute. Speroni held Gray’s header following defender Scott Golbourne’s cross soon after and winger Done flashed a low shot just wide as Barnsley finished the first half on top.
Scannell went close to firing the hosts into the lead five minutes after the restart, but lifted his shot from inside the area over the bar, as did midfield team-mate Mile Jedinak before Palace manager Dougie Freedman sent on Jonathan Williams and Jermaine Easter for Ambrose and Glenn Murray respectively with half an hour to go.
Tykes striker Davies had two goalbound shots blocked inside a minute and midfielder Nathan Doyle lashed a 25-yard effort off target as the visitors sensed a possible three points were there for the taking.
Easter’s effort from a similar position was blocked by Tykes substitute Michael Tonge in the closing stages, but Palace launched one last attack and when Dikgacoi crossed to the far post, Scannell was left unopposed to head past Button.
Crystal Palace: Speroni, Clyne, McCarthy, Gardner, Parr, Scannell, Dikgacoi, Jedinak, Ambrose (Williams 62), Murray (Easter 62), Martin (Appiah 77). Unused substitutes: Price,McShane.
Barnsley: Button, Wiseman, Foster, McNulty, Golbourne, Nouble (Tonge 65), Doyle, Dawson, Done, Davies (Collins 87), Gray. Unused substitutes: Lidakevicius, Smith, Cotterill.
Referee: T Kettle (Rutland).