They were then handed over to Ethiopian soldiers backing Somali authorities, Somali government sources said.
However, Ndubi said that the foreigners were businessmen trying to flee the fighting.
"Somalia is a failed state. How can they be given justice there?" he said.
Farah Maalim, a Kenyan politician representing some of the suspects, also condemned the men's deportation.
"I was denied access to them. I have been trying to get in touch with them in vain," he told a Kenyan newspaper.
UIC leaders in Somalia have vowed to fight a guerrilla war against the government forces and their Ethiopian allies.
They have claimed responsibility for recent attacks in Mogadishu, including a mortar attack on the presidential palace late on Friday and an ambush on an Ethiopian convoy on Saturday.
"Peace is possible if the interests of US and the Ethiopians are removed"
Ahmed, Bossaso, Somalia
Send us your views
"This is a new uprising by the Somali people," Ahmed Qare, deputy chairman of the movement, told AP news agency.
"The only solution can be reconciliation and talks between the transitional federal government and the Islamic courts."
The African Union has approved a nearly 8,000-strong peacekeeping force for Somalia, which has been without a functioning government since 1991 when Muhammad Siad Barre was ousted, leading to years of anarchy as rival clan leaders fought for power.
However many doubt the AU's capacity to muster such a force.