Brazil-born Cacau, who qualified to play for Germany last year, came off the bench to add to the two goals he scored in the 3-0 win over Malta to strengthen his case to be added in the starting line-up for Joachim Low's side. Germany start their FIFA World Cup campaign in Group D on 13 June against Australia after arriving in South Africa on 7 June after their final friendly. against Bosnia-Herzegovina next Thursday.
Alongside Cacau, Lukas Podolski and Mario Gomez weighed in with goals to cap impressive performances. With Germany captain Michael Ballack injured and out of next month's tournament, Bayern Munich striker Miroslav Klose took over the skipper's armband.
Having played in last weekend's UEFA Champions League final defeat, Bayern Munich quartet Bastian Schweinsteiger, Thomas Mueller, Hans-Jorg Butt and Germany'sinterim captain Philipp Lahm were all rested. Like Low, Hungarian coach Erwin Koeman opted for a 4-2-3-1 formation with Augsburg forward Sandor Torghelle as the lone striker.
Germany opened the scoring at the Ferenc Puskas Stadium when Podolski, playing as an attacking midfielder, drilled in a long-range shot which Hungarian goalkeeper Gabor Kiraly palmed over the bar. From the resulting corner, defender Per Mertesacker was fouled in the box and referee Claus Larsen had no hesitation awarding the penalty. Kiraly dived to his left and Podolski rifled his shot into the top right-hand corner to make it 1-0 to Germany with four minutes gone.
To make things worse for the hosts, defender Laszlo Bodnar was shown the first yellow card moments later for hauling down Podolski on the edge of the penalty area. Germany hammered the Hungarian defence in the first 20 minutes with Bremen's Mesut Ozil going close with three clear chances to score.
It finished 1-0 at the break, but early in the second-half Low brought on Stuttgart striker Cacau for midfielder Ozil and defender Dennis Aogo came on for midfielder Sami Khedira. Germany temporaily dropped their tempo in the second-half and with 60 minutes gone, Low introduced Marcel Jansen for rising star Toni Kroos, Marko Marin for Trochowski and Gomez for Klose.
Marin, who was a constant threat, made an instant impression when he slid a pass through to Gomez who beat Kiraly on 69 minutes. Kiraly's luck did not improve as his clearance kick was headed into the path of Cacau who drew the goalkeeper and tapped home his shot on 72 minutes to seal a convincing display from his side.