The octogenarian opened fire when the two men, aged 74 and 78, came upon him trying to set fire to the mosque's door on Monday afternoon, the police department said in a statement.
The victims were brought to a nearby hospital with serious injuries, while the suspected shooter was later arrested near his home.
The mosque has been cordoned off for investigations.
The incident came just hours after Macron had urged France's Muslim community to step up the fight against “separatism” in the wake of the latest attack by an Islamist radical on French soil, in which a police employee stabbed four colleagues to death.
There have been intermittent attacks on mosques in France since 2007, when 148 Muslim headstones in a national military cemetery near Arras were smeared with anti-Islamic slurs and a pig's head was placed among them.
In June this year, a gunman wounded an imam in a shooting at a mosque in the northwestern city of Brest, but police ruled out a terror motive.
In March, workers building a mosque in the small southwestern town of Bergerac found a pig's head and animal blood at the entrance to the site — two weeks after a gunman killed 50 Muslims in Christchurch, New Zealand, in a shooting spree at two mosques.
Mosques were also targeted after the killing of 12 people at the Charlie Hebdo satirical magazine in 2015 by Islamist radicals. Dozens of mosques were attacked by arsonists, others with firebombs, grenades or gunfire.