The parade was sponsored by a Samba club, Young Blood, O Globo reported. Three of the dead were men and one a woman.
The short circuit and fire knocked out electricity for about 6,000 homes in the neighborhood.
At least five people were seriously hurt.
The accident occurred shortly after 1 a.m. as the parade was reaching its end, O Globo said.
Many of those in the parade were supporters of the Santos Football Club, and the float where the deaths occurred honored Pele, Brazil's best-known soccer player, who spent much of his career with Santos. Antonio Wilson Vieira Honorio, better-known as Coutinho, who is generally regarded as second only to Pele in his ability, was present.
Coutinho called the deaths "sad."
"Unfortunately, people lose loved ones in an instant," he said.
Couple calls 9-1-1 over missing hash browns; assault McDonanld's employees
Video of Victoria’s Secret models trying to 'twerk' hits Instagram