Their white police van was ambushed in the early hours of Sunday morning in the southern district of Helwan.
Four gunmen in a truck sprayed the vehicle with bullets from automatic weapons, the interior ministry said.
Militants affiliated to so-called Islamic State (IS), who usually operate in the Sinai Peninsula, say they carried out the attack.
Known as Sinai Province, the IS faction has killed hundreds of security personnel in the Sinai region since the military overthrew Islamist President Mohammed Morsi in July 2013.
The insurgents have recently conducted hit-and-run attacks on police in Cairo and been behind small-scale bombings in the city.
BBC World Service Middle East editor Sebastian Usher says killing so many policemen so near Cairo is a worrying escalation.
The group posted pictures online, showing several bodies of the policemen riddled with bullets.