Income inequality fuels terrorism, Mayor Bill de Blasio said Tuesday, pointing to recent attacks in Belgium, Pakistan and elsewhere as evidence that the world needs to confront the gap between rich and poor.

Addressing mayors and other leaders from around the globe, de Blasio said security is hard to achieve without narrowing a widening income gap.

“I think we can safely say that in many nations of the world, lack of opportunity and a sense of doors being closed, unfortunately, has led to an environment where many people, particularly young people, have felt disaffected, have drifted toward extremist ideologies and sometimes toward violence,” de Blasio said before the Inclusive Growth in Cities Campaign at the Ford Foundation in midtown Manhattan.

Although he called the embrace of violence “unacceptable” and those who exploit inequality “cynical,” the mayor said: “We must address inequality to stop violence — whether that be over international issues or very local dynamics.”

The notion that income inequality is the wellspring of terrorism isn’t new.

In November, French economist Thomas Piketty argued in the newspaper Le Monde that the Middle East is a perfect storm for terrorism because of the region’s high concentration of its oil wealth into few hands — “the most unequal on the planet” — and the West is to blame for helping prop up the regimes.

De Blasio made eliminating income inequality a cornerstone of his 2013 mayoral campaign — he lamented that New York City had become “a tale of two cities” — and of his ensuing tenure at City Hall.

“Unfortunately, there’s always some fertile field when people feel there is no hope, society is not for them and the economy doesn’t offer them a pathway,” de Blasio said.