Jermain Defoe capped a stirring Sunderland fightback as they scored a priceless win over Chelsea to leave Newcastle in the Barclays Premier League relegation zone.
Sunderland started the day in the bottom three but swapped places with their north-east rivals, who drew at Aston Villa, by seeing off the deposed former champions 3-2 at the Stadium of Light.
Chelsea led at 1-0 and 2-1 - Diego Costa and Gary Cahill scoring either side of a beautifully hit volley from Wahbi Khazri.
Sam Allardyce's Black Cats then seized the moment with two goals in three minutes, Fabio Borini levelling against his old club and Defoe sealing the points after finding space in the box.
John Terry, set to leave Stamford Bridge at the end of the season, was sent off in the closing moments.
Newcastle could manage no better than a goalless draw at already relegated Villa to sit one point behind Sunderland, having played one game more.
West Ham lost their penultimate game at Upton Park as Swansea claimed a 4-1 win to dent the home side's European ambitions.
The visitors were two up at half-time through Wayne Routledge and Andre Ayew.
Ki Sung-yeung then made it 3-0 before Hammers substitute Diafra Sakho and Swansea striker Bafetimbi Gomis added to the scoreline.
Crystal Palace were 2-1 winners over Stoke at Selhurst Park, formally ensuring survival, with Dwight Gayle making a timely case for an FA Cup final starting spot.
He scored both of his side's goals in the second half to overturn a Potters lead earned through Charlie Adam's 27th-minute effort.
Bournemouth and West Brom, two sides who have already achieved their primary aim for the season by surviving, drew 1-1 at Dean Court.
Salomon Rondon gave the Baggies a 16th-minute lead but Craig Gardner spurned the chance to double the lead from the penalty spot.
Substitute Matt Ritchie made him rue that miss by grabbing an equaliser eight minutes from time.