كتب : Hatem Maher
Lewis Holtby put Germany in front on 73 minutes when he headed home a cross from Semih Aydilek.
Maicon leveled the score two minutes from time with a low shot that beat Germany keeper Ron-Robert Zieler at the near post.
The 19-year-old striker, who plays for Brazilian side Fluminense, notched the winner in stoppage time when he ghosted behind the defense to meet a long ball with a looping shot over Zieler.
"We wasted many opportunities but the players still kept their composure to claim a valuable win," Brazil coach Rogerio Lourenco told the post-match press conference.
Brazil, who won the tournament four times, will face the winners of Saturday's other game between UAE and Costa Rica.