Leicester were moments away from inflicting a first Premier League defeat on Spurs since Antonio Conte took charge, before Bergwijn grabbed a 95th-minute equaliser from Matt Doherty’s pass.
But there was more drama to come.
The Dutchman, who had only been introduced as 79th-minute substitute, then took the ball around goalkeeper Kasper Schmeichel in the seventh minute of stoppage time and scored the winner with the ball going in off the post.
It was a fitting finale to a thrilling match.
The Foxes had taken the lead against the run of play in the 24th minute with Patson Daka’s clinical finish over visiting goalkeeper Hugo Lloris with the hosts’ first shot on target.
But Harry Kane, who had earlier had a shot cleared off the line and also hit the crossbar, equalised just before half-time, collecting Harry Winks’ ball forward, cutting inside Caglar Soyuncu and side-footing past Schmeichel.
James Maddison then put Leicester ahead in the 76th minute after he had linked up well with substitute Harvey Barnes and the hosts thought they were collecting the three points before Bergwijn’s dramatic double.
Tottenham’s win takes them above north London rivals Arsenal and up to fifth in the Premier League, while Leicester are 10th in the table.