A goal deep into injury time from Sean Scannell earned Crystal Palace victory over Barnsley, moving them to within six points of the top six.
The visitors started brightly, Julian Speroni saving well from both Matt Done and Andy Gray.
Craig Davies also went close for Keith Hill's side, while Palace's best chance fell for Scannell.
He then grabbed the only goal when Kagisho Dikgacoi picked him out at the back post to head home the winner.
Barnsley's eighth defeat in nine games leaves them in 18th place, but 12 points clear of the bottom three.
Palace on the other hand are 11th, six points behind Birmingham City who occupy the final play-off place.
Crystal Palace manager Dougie Freedman :
"It may be one step too far but these players have a never-say-die attitude.
"We're unbeaten in 10 now so we're not a team that lies down so anything is possible. It just shows what resilience we have got.
"The belief that we showed to keep on going when the performance wasn't at its best is why we are doing so well this year. On the night Barnsley had all the possession but we've ended up with the points."
Barnsley manager Keith Hill:
"I'm devastated. I don't know what I have done to deserve this kind of misfortune. The performance was brave but to concede a goal so late is unbelievable.
"The players are hurting and I'm hurting because 0-0 would have been a fair result. We played good football up to the final third but I'm just numb.
"I can't ask any more from the players but we just have to accept that things aren't going our way at the moment."
Live Text Commentary
Full Time The game is over, as the referee blows his whistle.90:00 +2:04
Assist by Kagisho Dikgacoi.90:00 +2:04 Goal scored
Goal! - Sean Scannell - C Palace 1 - 0 Barnsley Sean Scannell finds the back of the net with a headed goal from close range. Crystal Palace 1-0 Barnsley.90:00 +1:59
The ball is delivered by Kagisho Dikgacoi,89:44
Free kick awarded for a foul by Michael Tonge on Kagisho Dikgacoi. Indirect free kick taken by Anthony Gardner.86:09 Substitution
Substitution Lee Collins replaces Craig Davies.86:09
Unfair challenge on Nathan Doyle by Kagisho Dikgacoi results in a free kick. Indirect free kick taken by David Button.84:52
Jonathan Parr sends in a cross, Scott Golbourne makes a clearance.83:43
Jonathan Williams takes a short corner.83:22
Jermaine Easter takes a shot. Blocked by Michael Tonge.79:32
The assistant referee signals for offside against Andy Gray. Patrick McCarthy takes the free kick.79:04
Sean Scannell takes a shot. Save by David Button.78:30
Stephen Dawson delivers the ball, save made by Julian Speroni.76:20
Patrick McCarthy restarts play with the free kick.76:20 Substitution
Substitution (Crystal Palace) makes a substitution, with Kwesi Appiah coming on for Chris Martin.76:20
Andy Gray gives away a free kick for an unfair challenge on Kagisho Dikgacoi.74:57
Nathan Doyle fouled by Kagisho Dikgacoi, the ref awards a free kick. Free kick taken by David Button.74:00
Craig Davies produces a right-footed shot from just outside the area that goes harmlessly over the bar.71:55
Free kick awarded for an unfair challenge on Kagisho Dikgacoi by Craig Davies. Julian Speroni restarts play with the free kick.70:44
Craig Davies takes a shot.
Foul by Nathan Doyle on Jonathan Williams, free kick awarded. Chris Martin crosses the ball from the free kick right-footed from right channel, David Button makes a save.66:55
Effort from just outside the box by Nathan Doyle goes over the bar.66:43
Craig Davies takes a shot. Blocked by Nathaniel Clyne.65:54
Craig Davies takes a shot. Blocked by Kagisho Dikgacoi.64:41 Substitution
Substitution Michael Tonge is brought on as a substitute for Frank Nouble.61:27 Substitution
Substitution Jermaine Easter comes on in place of Glenn Murray.61:27 Substitution
Substitution Jonathan Williams is brought on as a substitute for Darren Ambrose.60:34
Shot from just outside the box by Mile Jedinak goes over the target.59:37
The ball is crossed by Scott Golbourne.58:28
Darren Ambrose takes the indirect free kick.58:28 Booking
Booking Scott Golbourne receives a yellow card.58:20
Free kick awarded for a foul by Scott Golbourne on Chris Martin.57:18
The official flags Matty Done offside. Free kick taken by Julian Speroni.55:31 Booking
Booking Glenn Murray shown a yellow card.55:19
Free kick awarded for an unfair challenge on Stephen Dawson by Glenn Murray. Jimmy McNulty takes the free kick.54:59
Kagisho Dikgacoi gives away a free kick for an unfair challenge on Stephen Dawson. Free kick taken by Stephen Dawson.53:31
Stephen Dawson is caught offside. Julian Speroni restarts play with the free kick.51:27
Matty Done takes a shot. Mile Jedinak gets a block in.49:46
Sean Scannell produces a right-footed shot from inside the area that goes over the bar.48:45
Darren Ambrose takes the inswinging corner, Craig Davies makes a clearance.48:38
The ball is sent over by Nathaniel Clyne, clearance made by Stephen Foster.46:40
Centre by Darren Ambrose, Jimmy McNulty manages to make a clearance.45:29
Glenn Murray fouled by Scott Golbourne, the ref awards a free kick. Free kick taken by Patrick McCarthy.45:01
The referee gets the second half underway.45:00 +2:00 Half time
Half Time The whistle is blown to end the first half.45:00 +0:07
The ball is crossed by Darren Ambrose, clearance by Scott Golbourne.44:10
Matty Done produces a left-footed shot from just outside the penalty box that misses to the left of the goal.41:32
A cross is delivered by Nathan Doyle, Unfair challenge on Glenn Murray by Stephen Foster results in a free kick. Julian Speroni takes the indirect free kick.40:41
Nathan Doyle takes the free kick.40:41 Booking
Booking Mile Jedinak is shown a yellow card.40:35
Mile Jedinak challenges Stephen Dawson unfairly and gives away a free kick.39:22
Kagisho Dikgacoi gives away a free kick for an unfair challenge on Craig Davies. Craig Davies produces a strike on goal direct from the free kick, Kagisho Dikgacoi gets a block in.38:59
Free kick awarded for a foul by Jonathan Parr on Andy Gray. Scott Wiseman restarts play with the free kick.38:03
Darren Ambrose takes a outswinging corner from the right by-line played to the near post, Stephen Foster makes a clearance.37:12
Matty Done takes a shot. Save by Julian Speroni.36:20
Scott Golbourne sends in a cross, Andy Gray takes a shot. Save by Julian Speroni.35:29
A cross is delivered by Matty Done, clearance by Anthony Gardner.34:41
Free kick awarded for a foul by Sean Scannell on Stephen Dawson. Stephen Dawson takes the indirect free kick.32:22
Foul by Glenn Murray on Stephen Dawson, free kick awarded. Stephen Foster restarts play with the free kick.30:44
Matty Done takes a shot. Save by Julian Speroni.29:28
Foul by Stephen Dawson on Mile Jedinak, free kick awarded. Julian Speroni restarts play with the free kick.29:01
The ball is delivered by Darren Ambrose, David Button makes a clearance.28:37
The ball is sent over by Darren Ambrose, clearance made by Stephen Foster.26:33
Matty Done decides to take a short corner.26:27
The ball is delivered by Frank Nouble, blocked by Jonathan Parr.26:20
A cross is delivered by Frank Nouble, blocked by Kagisho Dikgacoi.24:18
Nathan Doyle produces a cross, Nathaniel Clyne manages to make a clearance.23:43
The ball is swung over by Scott Wiseman, blocked by Jonathan Parr.22:56
Frank Nouble takes a shot from inside the box clearing the bar.21:37
Sean Scannell has shot on goal from just outside the box which goes wide of the right-hand upright.19:42
Darren Ambrose takes the inswinging corner, free kick awarded for an unfair challenge on Stephen Foster by Patrick McCarthy. David Button takes the indirect free kick.19:37
Darren Ambrose delivers the ball, clearance made by Jimmy McNulty.11:28
Free kick awarded for a foul by Frank Nouble on Anthony Gardner. Free kick taken by Julian Speroni.10:21
Matty Done takes the outswinging corner, clearance made by Jonathan Parr.9:20
Shot by Craig Davies from just outside the area goes over the net.8:50
Corner taken by Matty Done from the left by-line to the near post, Kagisho Dikgacoi manages to make a clearance.8:26
Patrick McCarthy manages to make a clearance.8:26 Booking
Booking Stephen Dawson is shown a yellow card for unsporting behaviour.8:17
Corner taken by Matty Done,8:10
Frank Nouble sends in a cross, blocked by Anthony Gardner.7:55
Scott Golbourne produces a cross.5:12
Foul by Jimmy McNulty on Glenn Murray, free kick awarded. Darren Ambrose produces a shot on goal direct from the free kick.3:34
Patrick McCarthy takes a shot from just outside the penalty area which clears the crossbar.2:57
Outswinging corner taken right-footed by Darren Ambrose, Craig Davies makes a clearance.2:12
The official flags Craig Davies offside. Free kick taken by Julian Speroni.0:42
Unfair challenge on Glenn Murray by Stephen Dawson results in a free kick. Free kick crossed right-footed by Darren Ambrose.0:00
The game begins.
Live data and text provided by our data suppliers