Five policemen were wounded in the clashes at two apartments in the densely populated eastern Cairo neighbourhood of Ard al-Lewa, officials from the national security agency and Giza governorate police said.
The firefight began when security forces approached the two apartments after a tip-off that militants were holed up there, the officials said.
They said initial enquiries indicate the militants were planning to attack state institutions, the police, the military and the judiciary, and to blow up key installations.
Egypt is battling a local IS affiliate which has killed hundreds of soldiers and police in attacks since the military in 2013 ousted Islamist president Mohamed Morsi.
While the group is based in North Sinai province, it has also carried out attacks elsewhere including in the capital, and has claimed attacks that have killed more than 100 Coptic Christians since December.