Barcelona's loss in Germany was due to missed chances by Robert Lewandowski, who came back to haunt them.
The first half was dominated by the Spanish team, but after the break, they were dominated by the Germans.
Sane sealed the win with a goal after 50 minutes.
There were a lot of clear openings in the game.
Group C has six points from two games and it's in the hands of the Germans.
Inter Milan beat Viktoria Plzen 2-0 in the Czech Republic thanks to goals from Edin Dzeko and Denzel Dumfries.
This absorbing encounter between two European giants more used to meeting in the knockout stages of the competition rather than the group stage was the first return to the club of Robert Lewandowski since he moved to Barcelona.
The Pole was given a good reception by the fans before the game despite his desire to leave the club.
Before Tuesday night's game, he had scored nine goals in six games for his new club, but he missed several good first half chances.
He put over the bar with a volley from eight yards after being set up by a great ball with the outside of the boot.
He was denied a goal by Neuer with a far-post headed ball, the veteran keeper responsible for his side reaching half-time goalless having earlier saved well with his legs.
The best chance of the second half fell to Gavi, who hit the post.
Three draws in a row in the Bundesliga has led to a mini-crisis and questions over the future of the coach.
The 35-year-old made five changes, including dropping big-money summer signing Matthijs de Ligt to the bench. He was replaced by a World Cup winner.
The changes made by Nagelsmann did not have the desired effect immediately, with the team constantly being picked apart in a frenetic, end-to-end first half.
Leon Goretzka was introduced at half-time to try and establish control over the midfield and, while it was an old-fashioned set piece which provided the break through on 50 minutes, the second shortly after came through a superb move.
First, an inswinging near-post corner from Joshua Kimmich was met by the head ofHernandez, escaping the marking of Marcos Alonso and beating the goalkeeper to the ball.
Four minutes later, a driving run from the middle was set up by patient build-up play. Jules Kounde was left for dust by a cute chip finish over Ter Stegen in Sane.
Sane reacted badly to being replaced, throwing down his water bottle and storming from the bench.
Sane had to open the doors to the bench to get out. Despite this pressure-easing victory, the trap doors and pitfalls are still a threat.