There was also a rousing comeback win for Borussia Dortmund over Inter Milan and a big success for Valencia, but the greatest drama came at Stamford Bridge.
Ajax appeared to be heading for a stunning victory when Hakim Ziyech set up Donny van de Beek to put them 4-1 ahead 10 minutes into the second half.
Before that, Jorginho quickly levelled from the spot after Tammy Abraham's own goal gave the Dutch champions a second-minute lead, but a Quincy Promes header and a Kepa Arrizabalaga own goal made it 3-1 at the break.
After conceding again, Cesar Azpilicueta poked in from close range for Chelsea to pull it back to 4-2, and then came the crazy moment midway through the second half which really gave them hope.
In one fell swoop, Italian referee Gianluca Rocchi sent off Ajax's Daley Blind and dismissed Joel Veltman for a second caution for a handball in the box seconds later. Jorginho then converted the resulting penalty.
Teenager Reece James made it 4-4, and Chelsea thought they had gone in front when Azpilicueta fired in, but that goal was disallowed for an Abraham handball.
"I can't explain the game. For all the things we might analyse back, the madness of the game, we are here for entertainment I suppose and anyone who watched that has to say what a game of football. Respect to Ajax, what a spectacle," Chelsea boss Frank Lampard told BT Sport.
The result means Ajax, Chelsea and Valencia are level on seven points atop Group H, with the Spaniards coming from behind to beat Lille 4-1.
Nigerian striker Victor Osimhen put Lille ahead at half-time, but Dani Parejo's penalty restored parity and Valencia then scored three times in the last eight minutes.
Adama Soumaoro's own goal was followed by a stunning Geoffrey Kondogbia strike and a Ferran Torres effort. Lille are eliminated.
- 'Job done' for Klopp -
Liverpool won 4-1 in Genk two weeks ago and looked on course for another comfortable victory against the Belgians when Georginio Wijnaldum gave them the lead at Anfield.
However, with manager Jurgen Klopp resting several players ahead of this weekend's clash with Manchester City, the reigning European champions were pegged back.
Tanzanian striker Mbwana Ally Samatta headed Genk level before the interval, and it took a fine strike by Alex Oxlade-Chamberlain to win the game.
"The plan was to win the game and we did that, so job done," admitted Klopp.
Liverpool are top of Group E, a point above Napoli, who could have qualified for the last 16 with a win against Salzburg but were held to a 1-1 draw.
- Haaland scores again -
Erling Braut Haaland's early penalty -- the 19-year-old's seventh Champions League goal this season -- gave Salzburg the lead, before Hirving Lozano equalised.
In Germany, Inter looked to be heading for a second straight win against Dortmund as they raced into a 2-0 half-time lead with Lautaro Martinez and Matias Vecino scoring.
Yet Dortmund fought back in the second half to win the game as Achraf Hakimi grabbed a brace either side of a Julian Brandt goal.
It is a result that leaves Dortmund second in Group F, three points ahead of Inter and one behind Barcelona, who are still top despite a 0-0 draw at home to Slavia Prague.
- Messi denied -
Lionel Messi almost scored one of his finest goals, hitting the woodwork at the end of an exhilarating run in the first half.
Barcelona had not failed to score in a home Champions League group game in seven years and this result followed a shock weekend defeat at Levante.
"We haven't been convincing, either on Saturday (Nov 2) or today, and we know there is a lot of pressure now on the team. We have to respond," said coach Ernesto Valverde.
RB Leipzig top Group G after goals by Diego Demme and Marcel Sabitzer gave the Germans a 2-0 win at Zenit Saint Petersburg.
Lyon are two points behind them in second following a 3-1 defeat of Benfica.
Joachim Andersen and Bertrand Traore scored for Lyon either side of a goal from Memphis Depay, who has now netted in all four Champions League games this season. Haris Seferovic scored for Benfica.