Both were in critical condition in hospital, police said.
"Most of the victims were shot in the head as they slept," Milorad Veljovic, head of the interior ministry's emergencies department, told reporters at the scene in the village of Velika Ivanca, about 40 kilometres (25 miles) southwest of Belgrade.
"They were killed in five houses, mainly relatives and neighbours," he said.
Police said the motive for the killings, carried out with a semi-automatic 9-mm pistol shortly after 5 am (0300 GMT), was not known.
Veljovic said the gunman had fought in a 1991-95 war in Croatia and had a firearms permit. He and his son had been made redundant last year.
In 2007, a gunman in the eastern Serbian village of Jabukovac killed nine people and wounded two.