Jeremiah Kosoim of the Kenyan security services told journalists that those killed include a police reservist and two of the attackers as they targeted a communications mast in the area for destruction.
The security personnel not far from the area had responded killing two of the insurgents.
Somali militia group al-Shabaab has been targeting Kenyan interests in and out of the country since the government in Nairobi sent troops to Somalia to help defeat the insurgents.
The militants want Kenya to remove its forces from Somalia, a country which had descended into chaos since the overthrow of late Siad Barrie as president in the early 1990s.
Kenyan troops are part of an African Union force (AMISOM) which had succeeded in driving Shabaab fighters from Mogadishu and other parts of Somalia although they still retain large swathes of the country and the ability to launch sporadic raids on the capital and other cities.