Four people were hacked to death in skirmishes in Mathare slum between the outlawed Mungiki and Taliban groups that started on Sunday.
Police then shot two people as they attempted to contain the battles that erupted over protection money the gangs levied on brewers of an illegal drink.
A dusk-to-dawn curfew has been imposed on the slum.
Overnight, hundreds of Mathare residents camped outside Nairobi's military air base and many people continue to leave the area.
Kenyan television showed gangs of youth torching vehicles and shouting, "Kill, Kill."
The BBC's Gray Phombeah in Nairobi says the banned Mungiki sect is inspired by the bloody Mau Mau rebellion of the 1950s against the British colonial rule.
Thousands of young and poor Kenyans - mostly drawn from Kenya's largest tribe, the Kikuyu - have flocked to the sect whose doctrines are based on traditional practices.
According to Reuters news agency, police arrested their leader over killings and running extortion rackets among transport operators.
The Taliban were formed in Kenya's western city of Kisumu in the 1990s and are reputed to organise political violence but have no religious affiliation, unlike the Afghan Islamic fundamentalist group from which they took their name, AFP news agency reports.