Mexico put everything into a relentless first-half display which saw Hirving Lozano give his nation the lead and although Germany came on strong after the break, Juan Carlos Osorio's team held on to register a famous win to give themselves every chance of progressing from Group F.
In defeat, Germany failed to score in an opening game at a World Cup for the first time since 1978, while Mexico extend their first-fixture unbeaten streak to six matches.
Mexico almost took the lead within the first minute of the game, with Lozano only being denied by a last-ditch tackle from Jerome Boateng before up the other end, Timo Werner directed a shot marginally wide of the far post from 14 yards.
The game had been open from the first whistle and Mexico finally broke the deadlock just after the half-hour mark through Lozano, who cut inside onto his right foot and lashed the ball into the bottom corner after some fantastic buildup play from Javier Hernandez.
Soon after the restart, Germany went close to an equaliser through Toni Kroos, but the Real Madrid midfielder's free kick from 25 yards was fumbled onto the crossbar by Ochoa.
Mexico had used up a lot of energy in the opening 45 minutes and were less willing to throw men forward after the restart, but Hernandez and Vela should have combined to put their team into a two-goal lead before the hour mark after breaking clear, but Hernandez's pass was over-hit and the opportunity was lost.
Once that hour mark had passed, Germany took over with Mexico content to keep men behind the ball. Kimmich almost netted with an overhead kick from 12 yards before Julian Draxler saw a deflected effort go wide of the far post.
From the resulting corner, the ball found its way to Werner at the back post, but the striker volleyed over the crossbar from no more than eight yards after being put off by a slight deflection from a defender.
Mexico introduced Rafael Marquez - who is featuring at his fifth World Cup - but it did not halt constant pressure from Germany, with Kroos curling just wide from 20 yards and substitute Edson Alvarez denying Draxler with a timely block.
However, as Germany threw men forward, it left space at the other end and Miguel Layun twice went close with long-range efforts after leading counter-attacks, although both shots went off target.
As the full-time whistle edged closer, Mexico abandoned ambitions to counter and instead focused on keeping Germany out, but substitute Mario Gomez should have equalised for his side with two minutes left, instead heading over the bar from 10 yards out.
Fellow replacement Julian Brandt then drilled a half-volley from distance agonisingly wide, and it proved to be Germany's final chance as Low watched his side suffer a third defeat in four matches.
GERMANY (4-2-3-1): Neuer; Kimmich, Boateng, Hummels, Plattenhardt (Gomez 79'); Khedira (Reus 60'), Kroos; Draxler, Muller, Ozil; Werner (Brandt 86')
MEXICO (4-2-3-1): Ochoa; Salcedo, Ayala, Moreno, Gallardo; Guardado (Marquez 74'), Herrera; Layun, Vela (Alvarez 58'), Lozano (Jimenez 66'); Hernandez