A thrilling game saw Crystal Palace take charge in the first leg of their Division One play-off semi-final.
After a goalless first half, Sunderland took the lead through Marcus Stewart from the penalty spot, but Neil Shipperley soon headed an equaliser.
Iain Dowie's side then took the lead when Danny Butterfield's shot went in via a cruel deflection off Phil Babb.
Kevin Kyle levelled for the Black Cats but Andy Johnson restored Palace's lead as a low shot beat Mart Poom's dive.
The game began at a frantic pace, with Kyle firing wide of Nico Vaesen's goal as early as the sixth minute.
At the other end, Michael Hughes' fierce cross was headed behind for the game's first corner.
Palace skipper Neil Shipperley then failed to connect with a header from a cross by Julian Gray.
The lively Gray caused plenty of trouble down the Eagles' left flank, leaving the visitors reliant on occasional breaks against the run of play.
It was from one such break that Sunderland won a free-kick on the edge of the box - but Wales international John Oster curled his effort just over the bar.
51 mins: Marcus Stewart puts Sunderland ahead from the spot
52 mins: Neil Shipperley levels for Palace with a header
64 mins: Danny Butterfield's deflected shot puts Palace 2-1 ahead
85 mins: Kevin Kyle draws Sunderland level
87 mins: Andy Johnson hits a third for Palace
Gray soon wasted the best chance of the game when he blazed over from just inside the area.
Just before half-time, Sunderland's Jason McAteer found himself in the referee's notebook after a foul on Danny Granville.
McAteer failed to reappear after the interval, with Sean Thornton introduced by boss Mick McCarthy.
The Black Cats were soon purring when Tony Popovic clearly tripped Carl Robinson in the area, and Stewart calmly dispatched the spot-kick.
But almost immediately, Kyle was booked for a foul on Michael Hughes - and seconds later, Granville's cross was met by Shipperley, who flicked his header beyond Poom to equalise.
Stewart then nearly restored Sunderland's lead, but headed wide.
As the frantic start to the second half died down, Black Cats defender Phil Babb survived an appeal for handball against him - but the Republic of Ireland international did not remain lucky for long.
Hughes played a free-kick short to Butterfield, whose low shot took a wicked deflection off Babb's heel and squirmed past the diving Poom.
Oster was then cautioned in the aftermath - and was followed into the book by team-mate Gary Breen after a rash challenge on Johnson.
Smarting after their fourth booking of the night, Sunderland brought on Joachim Bjorklund for Darren Williams, and soon sacrificed Stewart to bring on Tommy Smith with 14 minutes left.
But when a good chance of an equaliser fell to Robinson, he failed to trouble Vaesen, lifting his shot over the bar.
The hard-working Hughes gave way to Shaun Derry as Palace looked to hold their lead.
After Gray was himself cautioned, Thornton fired the resulting free-kick into the area and after a melee which saw Aki Riihilahti appear to handle, Kyle fired home to draw the Black Cats level.
But almost immediately, Johnson ran at Breen and fired a low shot under Poom to restore Palace's advantage.
Fit-again defender Darren Powell came on for his first appearance since October as Dowie looked to further bolster his ranks - but it was Johnson who nearly grabbed a fourth in the dying minutes.
Crystal Palace: Vaesen, Granville, Leigertwood, Popovic, Butterfield, Gray, Riihilahti, Hughes (Derry 83), Routledge, Johnson, Shipperley (Powell 89).
Subs not used: Freedman, Black, Berthelin.
Booked: Hughes, Gray.
Sunderland: Poom, McCartney, Babb, Breen, Williams (Bjorklund 69), Robinson, Whitley, McAteer (Thornton 46), Oster, Kyle, Stewart (Tommy Smith 77).
Subs not used: Clark, Myhre.
Booked: McAteer, Kyle, Oster, Breen.
Referee: R Beeby (Northamptonshire)