Antoine Griezmann converted to give his side the lead after a tight first half had ended 0-0, but Mile Jedinak converted from the spot minutes later to equalise before Paul Pogba's deflected strike hit the bar and bounced over the line late on.
France fashioned the opening chance with two minutes on the clock, Kylian Mbappe bringing a save from Mat Ryan with an angled shot.
With Didier Deschamps' side dominating the early possession, Mbappe won a free-kick 25 yards out minutes later, but Pogba's strike was straight at goalkeeper Ryan.
A third chance in the space of the first six minutes arrived when Griezmann's attempt from the edge of the box following a swift France counter-attack was held by Ryan.
Ryan was again in the right place when an attempted Mbappe cross took a deflection before Australia broke to win a free kick that was whipped in by Aaron Mooy but came to nothing.
Mathew Leckie was booked for a foul on Lucas Hernandez after 12 minutes, but Australia repelled Griezmann's delivery into the box.
But with 17 minutes gone Hugo Lloris prevented Australia from taking the lead, making a fine low save after another Mooy delivery was deflected towards his own goal by Corentin Tolisso.
France's play had lost its early intensity, with passes beginning going astray and Australia growing in belief as the half-hour approached.
Griezmann was thwarted by a well-timed Trent Sainsbury challenge as France tried to get back on the offensive, and another good challenge from Sainsbury saw Hernandez blocked after he had found space on the left.
With five minutes until half-time and the game becoming increasingly scrappy, France were frustrated again as Mooy cleared and then Sainsbury got another key touch to a dangerous-looking cross towards Griezmann.
Neither coach made a change at the break, but France came out on the front foot and broke through when, after a VAR review, referee Andres Cunha pointed to the spot for a contentious penalty.
The moment came when, after 55 minutes, Pogba played the ball through to Griezmann, who was challenged by Josh Risdon. Cunha waved play on but, after a VAR review, a penalty was given and blasted home by Griezmann with 58 minutes played.
But just four minutes later Australia had a penalty of their own when Samuel Umtiti handled a Mooy cross, Jedinak keeping his cool to roll the ball low beyond Lloris to level the scores after VAR had confirmed the handball.
Tomi Juric replaced fellow forward Andrew Nabbout as Australia made a change and, buoyed by the equaliser, they threatened again as a good move involving Mooy resulted in a crossing opportunity that France blocked.
France coach Didier Deschamps made a double change as Olivier Giroud and Nabil Fekir came on for Griezmann and Ousmane Dembele, with Australia replacing Tom Rogic with fellow midfielder Jackson Irvine soon afterwards.
Deschamps made his final switch, Blaise Matuidi brought on for Tolisso, as the game headed towards the last 10 minutes.
And a minute later his side took the lead when Pogba's effort clipped off a defender and bounced off the bar and in, goalline technology confirming that it had crossed the line and another VAR check ruling that there had been no offside in the build-up.
Teenager Daniel Arzani came on for Robbie Kruse as Australia chased an equaliser, but they were unable to conjure another goal as France held firm for five minutes of added time.