Hirving Lozano's first-half goal made the difference between the two sides in an enthralling encounter in Moscow.
Javier Hernandez punished them with the pass that set up Lozano to fire home.
Toni Kroos almost replied with a free-kick but Guillermo Ochoa tipped it on to the bar.
Despite facing some sustained late pressure, Mexico held on to inflict a first World Cup defeat on Die Mannschaft since they lost to Spain in the 2010 semi-final.
This was also the first time a German side had lost their opening game of this tournament since 1982, when West Germany were upset by Algeria.
It could turn out to be a damaging defeat too. Although Germany will still be expected to beat Sweden and South Korea and progress, the runner-up in Group F will face a last-16 tie against the Group E winner, expected to be Brazil.
Even before they went behind, they were often over-run in the midfield, with Kroos and Sami Khedira unable to offer any protection from Mexico's rapid counter-attacks.
At the other end, Germany were also unconvincing in the early stages, with their famed midfield machine struggling to find a way through Mexico's determined defence.
Although they improved in the second half, and dominated possession, Germany's finishing touch eluded them and Mexico continued to cause problems on the counter.
Germany's sheer desperation to equalise was evident by the number of men they threw forward late on, including, at one stage, goalkeeper Manuel Neuer.
But Mexico fully deserved this victory, which brought huge celebrations from their thousands of fans who had travelled to Moscow, many in typically colourful costumes.
The intensity of Mexico's play was matched by their supporters, who not only out-numbered their Germany counterparts, but also out-sung them. That was not the only reason Germany looked rattled, but it certainly helped.
Lozano's pace and willing to drive at Germany's defence was the highlight of the first half, with only a last-ditch Jerome Boateng block denying him in the first minute and setting the pattern for the early stages.
The second half was more of a demonstration of Mexico's defensive capabilities, especially near the end - but they survived.
Courtesy: BBC News