Zenit St Petersburg striker Hulk scored after nine minutes when he muscled his way past a defender and fired home from 12 metres.
Hulk started for the first time since enduring a disappointing World Cup last year while coach Dunga gave debuts to Gremio goalkeeper Marcelo Grohe and Santos midfielder Lucas Lima.
Only two players remained from the side that lost the Copa America quarter-final to Paraguay in July.
Brazil dominated the first half and David Luiz almost gave them the lead after five minutes, shooting straight at the keeper when it looked easier to score.
Dunga’s team could not build on the Hulk goal and neither team looked particularly menacing for the remainder of an uneventful first period.
The pace quickened in the second half with Brazil looking the more dangerous.
Marcelo cut in from the left and came close twice in the first few minutes and Douglas Costa, one of Brazil’s best players, did the same.
Bryan Ruiz thought he had equalised in the 55th minute, smashing a through ball into the roof of the net, but Canadian referee Mathieu Bourdeau unfairly ruled it offside.
Bayern Munich’s Costa also had a goal unluckily chalked off with a quarter of an hour left.
Brazil perked up when Kaka replaced Hulk midway through the second half as the experienced midfielder brought an urgency and creativity to the side.
“It was great. I was proud to be back after eight months and feeling the warmth of the fans here was special,” Kaka told TV Globo.
“I feel I can contribute a lot in the short and medium term. I’ve played in two World Cup qualifiers and if Dunga wants me I have plenty to offer.”
Brazil meet the United States in a friendly on Tuesday in New England and then kick off their World Cup qualifying campaign against Chile in Santiago in October.
Costa Rica host Uruguay in a friendly next week.
(Reporting by Andrew Downie,; Editing by Tony Jimenez)