Steve MacLean stepped off the bench to snatch the points for Wednesday in a see-saw game at Hillsborough.
Former Wednesday striker Shefki Kuqi had snatched the lead for big spending Palace before Marcus Tudgay grabbed a first-half equaliser.
Palace went ahead again through midfielder Tom Soares, skipper Graham Coughlan headed Wednesday level before MacClean struck deep in injury time.
Tudgay had carved out three chances in the opening minutes firing wide and slamming two low shots straight at former Barnsley keeper Scott Flinders.
Kuqi, signed by Palace from Blackburn for £2.5million in the summer after a miserable season in the Premiership, broke the deadlock in the 21st minute with his second of the season.
The former Finland international, who left Wednesday for Ipswich on a free transfer three years ago, brushed aside full-back John Hills as he charged into the area to drill a low right-foot drive beyond the advancing Brad Jones for his second of the season.
Wednesday, watched by ex-West Brom boss Gary Megson, who is on the short-list for the vacant manager's job at Hillsborough, hit back in first-half injury-time.
Tudgay hit the target after a poor clearance by the Owls keeper Wade Small had picked out the little Wednesday striker who turned quickly to toe-poke the ball over the line from 12 yards.
Wednesday eased off though and allowed Palace back into the game. Midfielder Soares put Palace ahead in the 64th minute, skipping past his marker to finish with a low shot before Palace escaped minutes later, Danny Butterfield clearing Madjid Bougherra's header off the line.
Coughlan headed Wednesday level on 73 minutes powering a Kenny Lunt free-kick past Flinders from close range before MacLean stepped off the bench to replace Deon Burton.
Bougherra carved out the goal, flicking on a long throw and MacLean stuck out a foot to steer the ball past Flinders to stretch Wednesday's unbeaten run to three games.