The rampage in the capital Nairobi triggered protests by angry residents who blocked the road with burning tyres.
Police said the AK-47-rifle-wielding officer first shot his wife in the neck before firing indiscriminately at neighbours.
“We have lost six people all shot by the police officer before he committed suicide,” area police chief Francis Wahome said.
Two other people have been admitted to the hospital with injuries.
Wahome said the motive of the shooting was still unknown, adding: “We are told that the couple had issues and were quarrelling before.”
Cases of police officers shooting dead their spouses occur frequently in the East African country, where incidents of extrajudicial killings are rife.
Under-equipped, badly paid and trained, the police force has a poor reputation in Kenya, where it is considered the most corrupt organisation in the country, according to Transparency International.
Last month, another officer opened fire on his colleagues in central Kenya, fatally shooting one in the head before fleeing.
In March, a paramilitary officer killed one of his superiors in western Kenya following an altercation over deployment, and then committed suicide.
Another police officer in a jealous rage shot dead 10 people in a rampage through two bars in central Kenya in November 2010 before surrendering to police.