Pidcock celebrates his 25th birthday on Tuesday but the tyre mishap threatened to spoil the party, dropping him down from first to ninth place, 40 seconds off the pace.
But he picked his way through the field after a ponderous tyre change to bring himself back into contention just behind Koretzky, who was being roared on by a partisan home crowd.
Overhauling Koretzky with metres to spare in a helter-skelter dash for the line, Pidcock could scarcely believe what he had done.
"The Olympics is the biggest thing for me and to be able to just still pull that off despite what happened is pretty incredible," he said.
"What I'm feeling right now is a bit all over the place. All I know is that I did whatever I could in that race to win," he added.
Pidcock, who counts cycling legends Mark Cavendish and Bradley Wiggins among his heroes, is a cross-discipline cyclist with Tour de France stage wins and a cyclo-cross world title on his CV.
He entered Tour de France folklore in 2021 for his daredevil descent of the Galibier mountain pass, before climbing doggedly through massed and hysterical crowds to an epic stage win at Alpe d'Huez.
After learning to ride at the age of three, he credits racing on his bike to get to school on time for his cycling versatility.
Koretzky admitted he had "mixed feelings" about the race.
"Everyone dreams of an Olympic medal. It's still very satisfying," said the silver medallist, 29.
Pidcock said the race was "definitely the most emotionally draining victory" he had experienced.
"I knew if I could stay close, I could come around him near the finish, or have a chance," he added.