Huddersfield striker James Vaughan appeared to have condemned Barnsley to League One when he fired home an 82nd-minute equaliser, but when news filtered through that Palace had scored to lead against relegation rivals Posh, it appeared as though both sets of players agreed to ensure the staus quo and played out the last few minutes without further incident.
The draw ensured both sides stayed up at Peterborough's expense, ending an extraordinary Championship roller-coaster ride.
Chris O'Grady fired Barnsley into a first-half lead and after Jermaine Beckford had levelled for Huddersfield early in the second half, Tykes substitute Jason Scotland looked to have rescued his side's season when heading home their second in the 75th minute.
Vaughan snatched a second equaliser for Huddersfield to stun the travelling hordes, but when word spread that Palace had scored an 89th-minute winner, the John Smith's Stadium erupted into a Yorkshire celebration with both sets of fans in raptures.
Goals from Peterborough duo Lee Tomlin and Nathaniel Mendez-Laing were cancelled out by Glenn Murray and Kevin Phillips before Mile Jedinak struck late on to break the visitors' hearts.
Peterborough will be joined in League One next season by basement club Bristol City and Wolves, who went down 2-0 at Brighton - Kazenga LuaLua scoring both goals.
City's disappointing season ended with a 4-1 defeat against Charlton.