Crystal Palace are on the up as Shaun Scannell's 90th minute strike extended their unbeaten run to nine matches.
Richard Hines headed Sheffield Wednesday into an early lead, but Clinton Morrison levelled before the break for his ninth goal of the season.
But 17-year-old substitute Scannell capped an exciting home debut with the winner with less than a minute left of normal time.
The Owls opened the scoring on ten minutes and Palace keeper Julian Speroni must be partly to blame.
It all started from a free-kick taken from the right and Wade Small was involved in a crisp passing movement, before Frankie Simek shot low and Speroni should have done better to save.
Instead, the ball rebounded to Hines, who headed past the Argentinian keeper at the second attempt.
The Eagles kept their heads up with a number of useful strikes as Lee Grant, in the Wednesday goal, did extremely well with diving stops to prevent Tom Soares and Franck Songo'o from getting Palace back on terms.
But Palace's perseverance eventually paid off on 36 minutes. Ben Watson's free-kick found Danny Butterfield on the far right and his immediate cross was headed on by Mark Hudson for Morrison to finish off with a powerful header past Grant.
After the break, Wednesday made a promising start and substitute Lee Bullen forced Speroni to make a flying reflex save and then from 20 yards Jermaine Johnson clipped the top of the crossbar.
At the other end, David Martin fired from 30 yards out, forcing Grant to make a diving stop to turn round his post and from the resulting corner the unmarked Hudson headed straight into the arms of the Wednesday keeper.
Scannell was making a big difference and it was fitting that he won the points for Palace with a cool finish with seconds left.
Speroni's long punt downfield was flicked-on by Jamie Scowcroft to Morrison. The Palace striker shot straight at Grant, who had left his goal, but the ball fell to Scannell, who lobbed over four Wednesday defenders, leaving Neil Warnock an extremely happy man.