Police in the state of Sao 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 spokesman 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.
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 recognize it as gunfire, not New Year fireworks.
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 Sao Paulo, Brazil's biggest metropolis.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.