Prime Minister Omar Sharmarke told a special session of the UN Security Council on Somalia that the Shebab's recent pledges of allegiance to IS are "not to be taken lightly."
"Resolution of the crisis in Yemen is crucial," he said.
"Such will go a long way in keeping Al-Shebab from accruing support from ISIS, using Yemen as a conduit or launching pad."
The Shebab, meaning "youth" in Arabic, emerged out of an insurgency against Ethiopia, whose troops entered Somalia in a 2006 US-backed invasion to topple the Islamic Courts Union that was then controlling the capital Mogadishu.
Since their rout from Mogadishu in mid-2011, the Shebab have been significantly weakened, but several hotel attacks including a car bombing on the Sahafi hotel this month have highlighted the ongoing threat.
Signup to our newsletter and follow us on Facebook and Twitter!
"Complex attacks against hotels are now an indication that though Somalia and its international partners have won the battles against Al-Shebab, they have yet to be demolished," said Sharmarke.
Last month, Somalia's president called on Shebab fighters to surrender amid reports some factions had shifted allegiance from Al-Qaeda to IS.
Sharmarke cited the Shebab's "recent proclamation of allegiance to ISIS" as a worrisome sign and said Somalia "cannot afford to have a space for ISIS to exploit".
The prime minister called for international support to build up the security forces, which are backed by African Union troops.
Yemen has been engulfed in turmoil since a Saudi-led coalition launched air strikes eight months ago to push back an advance by Huthi rebels and restore the authority of the president.
IS fighters carried out attacks in the southern Yemeni city of Aden last month, raising fears that the group was seizing on the recent turmoil to expand its foothold in Yemen.
The United Nations has been trying for months to get peace talks between the Saudi-backed Yemeni government and the Huthi rebels off the ground, but no date has been set for the negotiations.