Cacau fired home four minutes into injury time as Germany somehow salvaged a draw in a dramatic finish to their friendly international against Euro 2012 co-hosts Poland in Gdansk.
Having reeled off a perfect record of eight wins to become the first side to qualify for the finals, the Germans were given a much sterner test by the Poles and looked like sliding to defeat.
Jakub Blaszczykowski fired home a penalty in the final minute after a foul by German goalkeeper Tim Wiese on Pawel Brozek to put the Poles 2-1 up.
But there was still time for Cacau to slam an equaliser into the roof of the net after Thomas Muller found the Brazil-born striker on the left side of the six-yard box.
Robert Lewandowski had given the home side a 55th-minute lead which was cancelled out by a Toni Kroos penalty for the Germans on 68. The Poles had Arkadiusz Glowacki sent off nine minutes from time.
Germany had the first chance of a lively opening spell with a fifth-minute effort from Miroslav Klose being tipped around the post by Polish keeper Wojciech Szczesny.
Szczesny pulled off another dramatic save, this time with his feet, to deny Simon Rolfes in the seventh minute, then punched away an effort from Philip Lahm two minutes later.
Poland had their first real chance on 11 minutes when Slawomir Peszko forced an acrobatic save from Wiese, then Peszko came close again on 28 when he fired a left-footed shot inches wide.
Szczesny was on hand again to deny Lukas Podolski on the half-hour mark before Poland missed a golden opportunity when Lewandowski knocked his shot over the bar from six yards.
Szczesny parried a Klose effort on 42 minutes and the second half continued in much the same fashion as the busy keeper parried a shot from Kroos on the German right.
Lewandowski converted a cross from the right by Blaszczykowski in the 55th minute to put the Poles 1-0 ahead and both Adrian Mierzejewski and Glowacki missed good chances to add to it.
Glowacki was booked in the 67th minute for a foul on Muller which gave the Germans their chance to equalise from the spot, Kroos firing home to the bottom right of Szczesny's net.
The Germans began to press for a winner with Andre Schurrle seeing one shot blocked by Daruisz Dudka in the box and a second rising effort clattering off the bar.
Jerome Boateng headed over the bar before the Polish challenge became tougher as Glowacki was red-carded for his second bookable offence.
Blaszczykowski thought he had won it for the Poles after Wiese's error but there was still time for the Germans to force a corner which Muller delivered and Szczesny punched clear.
Moments later a throw-in by Christian Trasch sparked another move which ended in Muller finding Cacau in the box and the striker coming to the Germans' rescue to preserve their six-match unbeaten run.