The Milan full-back struck in the 90th minute after Karim Benzema and a Kylian Mbappe penalty had cancelled out goals from Yannick Carrasco and Romelu Lukaku.
Lukaku thought he had won an enthralling contest for Belgium with 88 minutes gone, but it was ruled out for offside after a VAR check, and France made its luck count.
In an even opening to the game, Hugo Lloris made a stunning save to keep out Kevin De Bruyne's scuffed effort from close range before Mbappe went close at the other end.
With each side lining up in a 3-4-3 that cancelled out the other, the game began to drift before Carrasco collected De Bruyne's pass, drove into the box past Benjamin Pavard, cut back onto his right foot and drilled a shot in at the near post with Lloris wrong-footed.
It was 2-0 before the interval, Lukaku spinning away from the flat-footed Lucas Hernandez before side-footing high beyond Lloris, again at his near post.
France kept Belgium pinned back early in the second half but Antoine Griezmann got the ball stuck under his feet after a brilliant run and cut-back from Mbappe.
Mbappe was involved again when France finally capitalised on their dominance, slipping the ball to Benzema, who shot low on the turn beyond the reach of Thibaut Courtois.
Seven minutes later, Mbappe – who missed in the shoot-out loss to Switzerland at Euro 2020 – swept a penalty past Courtois after a VAR check saw Youri Tielemans punished for catching Griezmann.
A rasping effort from De Bruyne was tipped over by Lloris and Aurelien Tchouameni was denied by Courtois, with VAR intervening again when Lukaku thought he had prodded in a winner against the run of play, the Chelsea striker having strayed fractionally offside to meet Carrasco's cross.
Paul Pogba's spectacular free-kick cannoned off the crossbar before France's unlikely hero found the winner, Theo Hernandez rifling left-footed into the right-hand corner after Benjamin Pavard's cross found its way to the Rossoneri star.