"I wish to express the solidarity and the condolences of the nation to the victims' families," Macron said during a joint press conference with German Chancellor Angela Merkel at the end of a European Union summit in Brussels.
Merkel declared her "compassion for the victims' families".
Macron thanked the government and emergency services for mobilising support after the crash, in which a train ploughed into a school bus on a level crossing in south-west France, killing four school students and injuring more than a dozen, mainly teenagers.
A fifth teenager died on Friday.
Public prosecutors in Marseille have opened an inquiry and two examining magistrates were at the scene on Friday, officials announced.
Investigators only finished identifying the dead overnight because of the severity of the injuries.
The lower house of parliament also paid tribute to the victims and their families on Friday.
The "terrible accident" has "affected France and French families", Public Accounts Minister Gérald Darmanin said, after National Assembly vice-president Annie Genevard declared that tall the MPs were "deeply moved".
The bus driver was among the injured and has not been questioned, although the train driver has.
Questions over level crossing
The national rail company, the SNCF, has cited witnesses saying that the level crossing was working and said there was good visibility.
But Samuel Conegero, the father of one of the children, has said his son took a photo that showed the barriers were raised.
A 60-strong psychological support team was sent to the school to provide support for the families.
The accident is the worst involving a school bus in France since 1987, when 53 people including 44 children were killed in a pile-up involving two coaches that were taking students to a summer camp.
30 accidents a year
There are about 30 accidents a year on France's 15,000 level crossings.
The SNCF has promised to modernise them as debate rages as to whether the tragedy was the result of a technical failure.
Like 11,000 other French level crossings, the one at Millas is automatically activated by pedals on the rails that react to a train's wheels passing over them.
There are 163 crossings are declared safety priorities because they have been the scene of several accidents in the course of 10 years but the Millas crossing was not one of them.
There were 126 accidents on level crossings, in which 31 people died, in France in 2016.
According to the SNCF, 98 percent of such accidents were the fault of road users, the remaining two percent being due to vandalism, the weather or animals.