Senegal's second city was founded in 1659 and was the capital of the west African nation until 1957. It also served as the capital of French West Africa, as it was then known, between 1895 and 1902.
Macron pledged 15 million euros ($18.6 million) to fight coastal erosion in the sleepy city, known for its beautifully coloured buildings and colonial facades.
This will top up a 24-million-euro ($29.9-million) package from the World Bank to stem the ocean's advance.
The French leader also separately pledged 25 million euros ($31 million) to preserve and renovate local landmarks, including the cathedral and colonial-era mansions.
"We have seen the coastal erosion, the fears, the walls that have fallen, the economic activities destroyed and the town slowly receding in the face of what some deny -- the effects of climate change," Macron said.
Crowds thronged the city centre to cheer Macron and his wife, who flew into the city from the capital Dakar with their host, President Macky Sall and his spouse.
'Africa's Venice' fading
They sang songs of welcome and held up portraits of the two leaders and the first ladies. Some held the French tricolour and the Senegalese flag.
Macron and Sall waved to the crowd as they slowly drove into the city centre in an open-top limousine. Macron then walked around the Place Faidherbe, named after one of the most famous French colonial governors from the end of the 19th century.
"I am very touched by this warm welcome," Macron said.
Once known as "Africa's Venice", some of the finest examples of Saint-Louis' architecture are crumbling.
About 200 families have already lost their homes, several during the height of the storms of Senegal's rainy season in September.
The neighbourhoods worst-hit are mostly inhabited by fishermen living on the "Langue de Barbarie", a thin sandbank that protrudes to the surface between the ocean and the river.
Flood defence mechanisms have worsened the problem in the area, as well as making the river water salty, and debate is open over the potentially enormous costs of re-engineering the defences.
'We cannot stop the sea
Macron said the French development agency AFD would unblock 15 million euros so that a dyke could be built within a year to protect the inhabitants of the Langue de Barbarie.
World Bank president Jim Yong Kim meanwhile unveiled a $30 million (24 million euros) programme to relocate 900 families, or about 10,000 people living in the most vulnerable areas, he said, covering "people who would lose their homes in the near future."
He said although Africans had contributed little to carbon dioxide emissions, they were bearing the most devastating impact of climate change.
"They have to leave, we cannot stop the sea," Laurence Hart, the head of AFD in Senegal, told AFP.
Saint-Louis' fortunes began to decline as access to its port became difficult in the age of the steamship and the completion of the Dakar-Saint-Louis railroad in 1885 meant that up-country trade effectively circumvented its port.
After Senegal gained independence in 1960, Dakar became the capital and Saint-Louis slipped into a state of lethargy.
As its French population and military departed, many shops, offices and businesses closed. But it still draws hordes of tourists and is known for its international jazz festival which takes place in May.