Olivier Giroud headed in Antoine Griezmann's cross to break the France record
Les Bleus dominated, with Kylian Mbappe having an early goal ruled out for offside and Aurelien Tchouameni's bicycle kick being tipped onto the bar.
Giroud set up Mbappe for a fine opener, taking on several defenders before firing in from 16 yards.
AC Milan striker Giroud, 35, brilliantly headed in France's second.
At 35 years and 357 days, he is 70 days older than Roger Marche was when he scored against Spain in December 1959.
Giroud is now only two goals behind Thierry Henry's France record of 51.
France, who would have been relegated if they had lost, move above Austria going into Sunday's Group A1 finale in Denmark.
Croatia lead the group following a 2-1 win against Denmark, who would have sealed top spot themselves had they won in Zagreb.
Defender Borna Sosa put the hosts ahead with his first international goal. Manchester United midfielder Christian Eriksen levelled with a sensational long-range strike, but two minutes later Lovro Majer scored the winner from outside the box.
Croatia just need to beat Austria on Sunday to qualify for next year's finals and book a Euro 2024 play-off place.
-- Courtesy of BBC Sport