Iceland, ranked a lowly 131 in FIFA's world table, stunned their hosts when Teddy Bjarnason put them into a 28th minute lead, with Ajax striker Kolbeinn Sigthorsson doubling up five minutes later.
Whatever words of wisdom coach Laurent Blanc came up with at the interval evidently sank home as the second half was only seven minutes old when Lille defender Mathieu Debuchy reduced the deficit.
But France had then to wait until the 85th minute before Franck Ribery put them back on level terms with a lob for the Bayern Munich star's first goal for his country in three years.
Valencia back Adil Rami bagged the winner three minutes from time to extend France's unbeaten run to 19 matches.
France's next prep outing is against Serbia on Thursday in Reims, with their third and final warm-up scheduled for June 5 in Le Mans against Estonia.
Blanc's men are drawn in Group D at the European Championships and they begin their campagin in Donetsk against England on June 11 followed by co-hosts Ukraine and Sweden.
France struggle to beat Iceland in Euro warm-up
Advertisement