Gomez, who started ahead of Miroslav Klose in attack, ended a turgid opening 74 minutes with a pinpoint header into the corner of the goal, outjumping Joao Pereira six yards out from Sami Khedira’s cross.
Portugal had hit the crossbar just before half time as defender Pepe’s close-range shot cannoned onto the line and away.
The game was a disappointing spectacle considering the talent on show, with much of the play getting bogged down in midfield as the Portuguese defended in numbers.
Gomez glanced an early header at goalkeeper Rui Patricio from a Jerome Boateng cross.
Arsenal’s new signing Lukas Podolski skidded a low first-time shot straight at the goalkeeper barely ten minutes in.
Cristiano Ronaldo skipped past Boateng down the left to slide a cross into the box, but Helder Postiga failed to make contact at the near post; Portugal’s first moment of danger.
The Germans had the ball in the net on 24 minutes, but French referee Stephane Lannoy decided to award a free kick against Portugal for a foul by Chelsea’s Raul Miereles on Real Madrid’s Sami Khedira in the buildup.
Podolski had plenty of time to line up a shot off a Mesut Ozil low ball from the left, but the Polish-born forward couldn’t keep it down.
Portugal proceeded to frustrate the Germans by defending in numbers, crowding out the midfield to ensure attacks came to nothing.
A fierce cross from Ozil was intercepted by Bruno Alves before the Germans missed a good double chance.
The ball fell to Podolski unmarked at the back post, he chose to volley it back across goal rather than shoot and Tomas Muller side-footed wide.
Portugal nearly took the lead against the run of play as Real Madrid defender Pepe struck the crossbar after a corner fell to him eight yards out. The ball crashed down onto the line but didn’t cross it.
The second half saw the pace pick up intially, as a chipped cross from Nani was athletically headed clear by Borussia Dortmund centerback Mats Hummels.
Mario Gomes directed a header over on 57 minutes after the Portuguese gave the ball away cheaply.
The Germans then lost the ball too easily themselves, allowed Nani burst through the center and release Ronaldo on the edge of the box, but Boateng got across quickly to charge down his left-footed shot.
Gomez headed home with Klose waiting on the touchline to replace him, prompting coach Joachim Low to send the Lazio striker back to the bench.
Ronaldo hit a trandmark dipping shot on 81 minutes that Manuel Neuer awkwardly palmed away.
Ronaldo then turned provider, poking to Real Madrid teammate Fabio Coentrao on the edge of the box only for Hummels to get a vital diving block in.
Portugal squandered the chance of the match with three minutes left. Substitute Nelson Oliveira set up fellow replacement Silvestre Valera, but the latter blasted straight at Neuer from point-blank range.
Holger Badstuber blocked a last-minute shot from Nani, and Bruno Alves headed over from the resulting corner.
The win takes the Germans joint top of the group after Denmark’s surprise 1-0 win over the Netherlands earlier Saturday.
Germany face the Netherlands next on Wednesday, with Denmark playing Portugal.
Germany: Manuel Neuer, Mats Hummels, Holger Badstuber, Phillipp Lahm, Jerome Boateng, Sami Khedira, Bastian Schweinsteiger, Mesut Ozil (Toni Kroos, 87), Thomas Muller (Lars Bengder, 90), Lukas Podolski, Mario Gomez (Miroslav Klose, 79).
Portugal: Rui Patricio, Bruno Alves, Pepe, Fabio Coentrao, Miguel Veloso, Joao Periera, Joao Moutinho, Raul Miereles (Silvestre Varela, 79), Nani, Cristiano Ronaldo, Helder Postiga (Nelson Oliveira, 69).
- 30/04/2015 Russian FC Spartak to fine Armenian footballer for violating contract terms
- 29/04/2015 Barca on fire with 6-0 win over Getafe
- 23/04/2015 Real Madrid finally crack Atlético resolve
- 23/04/2015 Juventus edge past Monaco and into semis
- 17/04/2015 Europa League: The results of the first matches of 1/4 finals
- 16/04/2015 Suárez at the double as Barcelona beat Paris
- 16/04/2015 Porto beat Bayern 3-1 in quarter-final first leg, German side's first ever loss in Portugal
- 05/04/2015 Fenerbahce team bus attacked on journey home from Rizespor match
- 30/03/2015 Euro 2016 qualifiers: Germany, Portugal boost hopes
- 28/03/2015 European Championship Qualifying: Azerbaijan 2 - 0 Malta
- 19/03/2015 Barcelona beats City 1-0 to advance to CL quarterfinals
- 19/03/2015 Juventus beats Dortmund to advance in Champions League
- 18/03/2015 Monaco knocks out Arsenal; Atletico gets by Leverkusen to reach Champions League quarterfinals
- 12/03/2015 Ten-man Paris through after stunning Chelsea
- 12/03/2015 Bayern Munich hit seven past 10-man Shakhtar Donetsk to reach last eight
- 11/03/2015 Real Madrid and Porto head to Champions League quarters
- 27/02/2015 Besiktas kicks Liverpool out on penalties
- 25/02/2015 Suarez puts Barca on top as Messi misses penalty
- 18/02/2015 Chelsea gets precious draw in Paris in Champions League
- 16/01/2015 Atletico Madrid knock neighbors Real out of Cup
- 12/01/2015 Cristiano Ronaldo wins second straight Ballon d'Or award as FIFA World Player of the Year
- 17/12/2014 Azerbaijani President allocates AZN 1m to Qarabagh FC
- 14/12/2014 Moscow hosts mini-football tournament devoted to memory of Tofig Bahramov - PHOTOSESSION
- 12/12/2014 Gurban Gurbanov: "There was not offside in that episode
- 11/12/2014 Karabakh FC 0 - 0 İnternazionale
- 11/12/2014 Bayern Munich edge off CSKA Moskva 3-0 in UEFA Champions League
- 28/11/2014 Pele to visit Azerbaijan
- 28/11/2014 Turkey's Galatasaray to part ways with Prandelli
- 28/11/2014 Europa League: St. Etienne 1:1 Karabakh
- 27/11/2014 European Champions League results
- 26/11/2014 European Champions League results
- 23/11/2014 Messi becomes all-time top scorer in Spanish La Liga
- 05/11/2014 Real Madrid defeat Liverpool to qualify for last 16 of Champions League
- 05/11/2014 Borussia Dortmund smash Galatasaray again - Results
- 26/10/2014 Galatasaray elects Duygun Yarsuvat as the new chairman
- 26/10/2014 Football: Fenerbahce beat Genclerbirligi in last minute
- 26/10/2014 Real Madrid outclass Barcelona after Ronaldo’s penalty turns tide
- 24/10/2014 Europa League: "Dnepr" - "Karabakh" - 0:1
- 23/10/2014 Borussia Dortmund tears apart Galatasaray 4-0
- 01/10/2014 Bayern Munich beat CSKA Moscow in Russia