Police in the state of São Paulo said the shooter is believed to have been angry over a separation from his former wife, who was among those killed. Local media reports said the couple's 8-year-old son also died.
A police spokesperson could not confirm the identity or age of those killed or whether a child of the shooter, who also remains unidentified, was among the victims.
At least 39 killed in New Year gun attack at Istanbul nightclub
Local media reported that a total of 15 people had been shot and several remain in critical condition.
A neighbor interviewed by the Globo television network said that he and family members heard blasts about a quarter to midnight but did not immediately recognise it as gunfire, not New Year fireworks.
Only when one of those shot ran into their property, bleeding and asking for help, did they realise that someone had been shooting. State police said they were called to the scene at 12:40 a.m. local time.
Turkey 'Santa' nightclub attack: What we know
Although Brazil struggles with high rates of crime and violence, mass shootings are uncommon. Gun deaths are frequent in heists, holdups and in confrontations among police, drug gangs and other criminals, but shooting sprees like those often seen in the United States are not prevalent.
Campinas, an industrial and university city of over 1 million residents, is located about 100 kilometers northwest of the city of São Paulo, Brazil's biggest metropolis.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ