Police officers recovered two pistols during the botched robbery.
Nairobi County Commander Japheth Koome says a police officer was injured in the chest during the shootout.
“Our police officers were acting on a tip off from members of the public,” he said.
The officer was rushed to hospital but has since been discharged.
The group had tried to stage a robbery in Highridge but changed their plans after realising they were being pursued by police who were trailing them from Westlands.
According to police, the five have been involved in several robbery cases within Nairobi.
“It is a notorious gang…we have been following them for a while,” Koome told Capital FM News.
The incident caused a huge traffic jam along the busy highway but was cleared after the bodies were moved to mortuary.
Koome has urged youths to desist from engaging in criminal activities.