Elite Iraq interior ministry forces and Kurdish Peshmerga fighters managed on early Monday to control Luhaiban village, though the militants have left some houses booby-trapped with explosive devices, the sources said.
In a separate attack on Sunday, Islamic State militants killed four Peshmerga soldiers and a civilian, and wounded six other people when they attacked Qara Salem village in northern Iraq, security sources said.
The Ministry of Peshmerga Affairs said in a statement that the attack caused casualties, but did not confirm the toll.
Peshmerga are the military forces of the autonomous region of Iraqi Kurdistan.
One Peshmerga colonel said Islamic State fighters were using hit-and-run tactics in night attacks on their positions.
"They avoid holding the ground for longer time ... More reinforcement forces were dispatched to the area to prevent further attacks," the colonel said.
Iraqi forces and Kurdish Peshmerga fighters reinforced their troops in the area on Monday where the attacks had been carried out by militant group with Iraqi military helicopters flying over to chase militants, two Iraqi security sources said.
The two villages are in remote territory claimed by the Iraqi government in Baghdad and the government of the autonomous northern Kurdish region in Erbil where there are regular attacks by Islamic State.
But it is a rare incident of Islamic State militants controlling a residential area near a main road, a highway that links Erbil to the city of Kirkuk.
Iraq declared victory over the hardline Sunni militant group in December 2017. Although the group has largely been defeated, it continues to carry out sporadic attacks and operate limited cells in the country, particularly in the north.