Brazil managed a 1-0 friendly victory over Germany to earn a measure of closure after their humiliating defeat at the 2014 World Cup.
The two world footballing powers were meeting for the first time since Germany embarrassed Brazil 7-1 at home nearly four years ago.
But Brazil's defense was stauncher in Munich on Tuesday and Gabriel Jesus' lone goal proved to be the difference.
Jesus pushed forward on the counter-attack in the 36th minute, only to blast his shot well over the bar from 15 yards.
However, less than a minute later, Willian sent a curling cross into Jesus, whose powerful header was straight at Germany goalkeeper Kevin Trapp but looped up and over the line.
Germany nearly stole a draw in the 92nd minute when Toni Kroos found space to shoot, but goalkeeper Alisson did well to save.
The defeat ended Germany's 22-game unbeaten streak, which came one game short from matching their record of 23 from 1978-81. Brazil also halted another Germany 22-game unbeaten run in 1998.