The Tottenham Hotspur striker Dempsey netted his 34th and 35th international goals in his 96th appearance for the USA, moving past Eric Wynalda into second on the all-time USA scoring list, 14 shy of Landon Donovan's record.
Dempsey's brace gave the Americans a dream 4-1 lead in the U.S. Soccer Federation's (USSF) centennial celebration match just four days after they struggled in a 4-2 loss to Belgium.
A German side missing many of its top stars battled back on late goals by Max Kruse and Julain Draxler, but could not net the equaliser, falling to 6-3 against the Americans with their first loss to a USA side since losing 2-0 in 1999.
Former German star Jurgen Klinsmann coached the Americans on Sunday against a German side he managed in the 2006 FIFA World Cup Germany™, a team now guided by his former assistant, Joachim Low.
German substitute Heiko Westermann's header in the 51st minute off a corner kick from Kruse pulled the visitors within 2-1.
But the Americans answered in the 60th minute, Jozy Altidore playing the ball to his right into the penalty area and Dempsey taking it on one bounce and hammering a shot into the back of the net.
Dempsey struck again four minutes later, firing a left-footed rocket from just beyond the penalty area for a 4-1 US lead.
Kruse pulled one back for the Germans in the 79th minute and Draxler trimmed the margin to 4-3 in the 81st, taking the rebound off a Sydney Sam shot that US goalkeeper Tim Howard sprawled to deflect and tapping the ball unchallenged into the goal.
But the USA stiffened at the finish to preserve the victory.
German defender Per Mertesacker missed a golden chance from the heart of the penalty area in the tenth minute while one-on-one with Tim Howard, pushing his shot just wide of the goal to the right of the Everton goalkeeper.
Altidore gave the Americans the lead in the 13th minute, blasting a cross from Graham Zuzi with a left-footed volley into the back of the net from just inside the penalty area.
A 16th-minute blunder by German goalkeeper Marc-Andre ter Stegen gave the USA side a 2-0 edge. Ter Stegen misplayed a pass from defender Benedikt Howedes and the ball rolled off his foot and across the goal line.
In the 24th minute, German captain Miroslav Klose took a breakaway pass and flicked a right-footed shot past a helpless Howard, but the Lazio striker was offside on the play, nullifying the effort as Germany trailed 2-0 at half-time. Klose remains one goal shy of Gerd Mueller's all-time German national team record of 68 goals.
The Germans lacked several top names from Champions League finalists Bayern Munich and Borussia Dortmund and Real Madrid stars Mesut Ozil and Sami Khedira. But they boasted Lars and Sven Bender, the first twins to start for Germany in 39 years.
Germany was the final opponent for the Americans ahead of three crucial Brazil 2014 qualifying matches later this month. The USA squad plays at Jamaica on Friday, then hosts Panama four days later and Honduras on 18 June.