The gunmen approached Thomaz Alckmin's car in what police say may have been an attempted robbery or kidnapping.
Mr Alckmin's bodyguards and the gunmen exchanged fire in Morumbi, in the south of the city of Sao Paulo.
Sao Paulo, Brazil's richest city, has one of the country's worst crime rates.
Police said gunmen stopped the car of Mr Alckmin, 30, and his 9-year-old daughter as they were leaving a social club in Morumbi.
Mr Alckmin's guards opened fire, forcing the attackers to flee. The gunmen's car was later found with blood stains, police said.
Mr Alckmin and his daughter escaped unscathed.
This is not the first time Thomaz Alckmin's guards have been involved in a shootout.
In 2002, one of his security guards died after a gunfight with armed robbers outside the home of Mr Alckmin's girlfriend.
His father, Sao Paulo state Governor Geraldo Alckmin, has received death threats from a powerful criminal gang calling itself First Command of the Capital (PCC).
The son and granddaughter of Geraldo Alckmin, the governor of the Brazilian state of Sao Paulo, were caught up in a gunfight between their security guards and gunmen on Sunday, police say.