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).
- 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
- 29/09/2014 Belarusian Alexei Kulbakov named for Inter Milan-Qarabag match
- 19/09/2014 Baku to host four matches of UEFA Euro 2020
- 19/09/2014 UEFA to select hosts for Euro 2020
- 29/08/2014 Karabakh FC through to the UEFA Europa League group stage for the first time
- 28/08/2014 The UEFA Champions League group stage draw result is displayed in Monaco
- 23/08/2014 Atletico beat Real Madrid to Super Cup
- 15/08/2014 Suarez trains and is "happy to feel like a footballer again."
- 13/08/2014 Real Madrid 2-0 Sevilla: Ronaldo double seals Super Cup
- 07/08/2014 Neftchi FC qualified for play-off in the Champions League
- 07/08/2014 Turkish Trabzonspor to sign Benfica's Cardozo
- 30/07/2014 Former Brazil coach Scolari takes charge of Gremio
- 13/07/2014 World Cup 2014: Brazil 0-3 Holland
- 12/07/2014 Luis Suarez to appeal FIFA ban: Lawyer
- 12/07/2014 FIFA bans Nigeria from international football
- 11/07/2014 Russia to cancel visas for World Cup fans in 2018 for first time in history
- 10/07/2014 Rousseff urges unity after Brazil's World Cup shame