The five-time World Cup winners appeared on course for a comfortable victory following first half goals from central defender Luisao and team captain Kaka.
But an own goal from Maicon, under pressure from Alex Frei, brought Switzerland back into contention with 20 minutes remaining.
The home side then had two good chances to equalise with debutant Brazil goalkeeper Helton tipping a Tranquillo Barnetta strike over the crossbar and Philippe Senderos heading wide from a Hakan Yakin free kick but the visitors held on to make it four wins and a draw under the guidance of Dunga.
"It was a good game and it was natural that the home side would come back stronger in the second half after we dominated the first," said the Brazil coach afterwards.
"We have a lot of players who still haven't played that much together," Dunga added after fielding a starting line-up with nine changes from the side that lost to France in July's World Cup quarter-finals.
"There is still lots to improve on but it will come."
Switzerland were the only team to exit the World Cup without conceding a goal and their defence looked solid once again in the opening stages of Wednesday's match.
DEFENSIVE ERRORS
Two uncharacteristic errors allowed Brazil to take control however with Luisao first heading home an Elano corner in the 22nd minute after comfortably breaking free of his markers.
Kaka then slid the ball into an empty net ten minutes before the break after benefiting from a poor back-pass by Swiss striker Johan Vonlanthen.
Goalkeeper Pascal Zuberbuehler got to the ball first after racing off his line but could only crash it into the Brazilian's path following an unfortunate deflection off defender Johan Djourou.
The introduction of Ronaldinho in the 62nd minute looked set to complete Switzerland's misery, particularly when the Barcelona playmaker put Kaka through once again within a minute of his substitution.
This time the captain could only hit the post though and it was Brazil who found themselves on the back foot in the final minutes after Maicon's header into his own net.
"In the last half hour we can say that we could have, should have or would have been able to get a more positive result but the reality is that we lost," Switzerland coach Koebi Kuhn reflected.
"Against a great team like Brazil it's not so tragic of course, but we would certainly have liked to have ended the year in better fashion.
"We played too nervously at the start and didn't find our rhythm until that last half hour, but we have a lot of players who have not been playing regular football at their clubs and I think this kind of match was important to show them what it takes to be successful at international level."