The UN chief said military intervention could lead to sectarian warfare.
"Military strikes against ISIS might have little lasting effect or even be counter-productive if there is no movement towards inclusive government in Iraq," he said in a speech to the Asia Society in New York.
He also urged the Iraq government and its supporters to refrain from carrying out revenge attacks.
"Sectarian warfare is a disaster for all. It generates a vicious circle of polarization and terrorism. It is crucial for the region’s leaders -- political and religious -- to call for restraint and avoid further contagion. I hope other countries, including Saudi Arabia and Iran as well as other regional."
He said ISIS presented a threat to all communities in Iraq, calling on moderate Arab Sunnis, Kurds and Shiites to work together.
The United States is considering a request from the Iraq government to launch airstrikes against Sunni militants. US officials have said that if airstrikes were carried out, Syrian targets could also be hit in a bid to reduce the presence of ISIS in the region.