The attack occurred on Saturday around 7:30 pm (1630 GMT) in the villages of Juhudi and Salama in Lamu county, which borders Somalia, the police source said.
"Five people were killed. The victims were slashed and there are others who were beheaded," the source elaborated.
Another local resident, Ismail Hussein, said that the militants stole food supplies before leaving, firing their arms into the air.
Based in Kenya's eastern neighbor Somalia, the jihadist Al-Shabaab group has been waging a bloody insurgency against the fragile government in Mogadishu for more than 15 years.
Kenya first sent troops into Somalia in 2011 to combat the Al-Qaeda*-affiliated Islamist militants and is now a major contributor of troops to an African Union military operation against the group.
But it has suffered a string of retaliatory assaults, including a bloody siege at the Westgate mall in Nairobi in 2013 that cost 67 lives and an attack on Garissa University in 2015 that killed 148 people.
In Somalia itself, Al-Shabaab has continued to wage deadly attacks despite a major offensive launched last August by pro-government forces, backed by the AU force known as ATMIS.
* Al-Shabaab and Al-Qaeda are terrorist organizations banned in Russia and many other states.