Azoulay, 45, came from behind to defeat Hamad bin Abdulaziz Al-Kawari, also a former culture minister, after he failed to pick up support from other Gulf states which are part of a Saudi-led coalition blockading Qatar. The vote was 30 to 28.
The campaign to succeed UNESCO's outgoing chief Irina Bokova was overshadowed by Washington's announcement Thursday that it planned to withdraw from the Paris-based body after years of tensions over decisions seen as critical of Israel.
US withdraws from UN's cultural agency UNESCO
In the face of the Arab divisions, France presented Azoulay as a consensus figure who could mend fences and soothe tensions with Israel.
"In a time of crisis, we need more than ever to get involved (and) work to strengthen the organisation," Azoulay said after the final vote.
Azoulay, who is Jewish of Moroccan origin, will face the difficult task of trying to persuade the United States and Israel to remain as members.
Just as daunting will be her job of reforming the agency struggling under the weight of a bureaucracy that has become unwieldy over the seven decades since it was founded.
French President Emmanuel Macron hailed her victory on Twitter, saying: "France will continue to fight for science, education and culture in the world."
US pulls out of UN cultural body, citing 'anti-Israel' bias
Azoulay, who will become UNESCO's second woman leader after Bokova, had edged out Egyptian rights activist Moushira Khattab earlier Friday as the main challenger to Al-Kawari, the frontrunner until the final run-off.
Azoulay's nomination must be approved by the agency's 195 member states on November 10, a vote that has never previously gone against the board's nominee.
Arab states believed the job of director-general of the organisation should go to one of them for the first time, but regional rivalries and the US and Israeli withdrawals undercut their ambitions.
Egypt threw its weight behind Azoulay after Khattab dropped out, a member of her delegation told AFP.
Egypt is part of the coalition led by Saudi Arabia that has been blockading strategically placed Qatar since June over its alleged support for radicals and its ties to Iran.
Lebanon's candidate Vera El-Khoury, who bowed out at the fourth round of voting, told AFP that the power game at play in the race had shown UNESCO members "did not give a damn" about the candidates' programmes.
UNESCO announces West Bank city of Hebron a heritage site
Qatar has generously funded UNESCO in recent years and lobbied intensively for the post, which would have helped bolster its international status at a time when it faces isolation in the Gulf.
Al-Kawari had also been dogged by old allegations of anti-Semitism after the Simon Wiesenthal Center accused him of remaining silent about anti-Semitic books at a fair in Doha when he was culture minister.
UNESCO is best known for its World Heritage sites including tourist favourites such as the Grand Canyon or Cambodia's Angkor Wat, but it also runs science, media training and cultural programmes internationally with an annual budget of about $250 million (210 million euros).
The US decision to withdraw, which is to take effect on December 31, 2018, underlined America's drift away from international institutions under President Donald Trump.
Washington has walked out on UNESCO once before, in 1984, after a row over funding and alleged anti-US bias.
Washington returned to the fold in 2002, seeing UNESCO as a vehicle for combatting extremism in the wake of the September 11, 2001, attacks.
But in 2011 relations soured again after UNESCO admitted Palestine as a full member, prompting the US to cut its funding to the organisation, leaving a gaping hole in its finances.
In just over a year as culture minister under Socialist president Francois Hollande, Azoulay secured a budget increase for her ministry after years of deep cuts.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ