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).
- 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
- 10/07/2014 World Cup: Argentina To Face Germany In Final
- 10/07/2014 Dutch captain Van Persie doubt for semifinal
- 09/07/2014 Germany scores five goals in 29 minutes against Brazil to set World Cup record
- 09/07/2014 Soccer-Klose scores 16th World Cup goal to break all-time record
- 06/07/2014 Sub Krul wins shoot-out for Dutch
- 05/07/2014 Higuain's early strike enough for Argentina
- 05/07/2014 Neymar out of World Cup
- 05/07/2014 World Cup 2014: Brazil Defeats Colombia, 2-1
- 04/07/2014 Germany wins France 1-0, advances to semifinal
- 03/07/2014 Galatasaray confirm talks with Prandelli - PHOTO
- 02/07/2014 Belgium beats US 2-1 in extra time of World Cup game
- 02/07/2014 Stephen Keshi steps down as Nigeria coach
- 01/07/2014 Argentina beats Switzerland 1-0 after extra time
- 01/07/2014 Schurrle, Ozil takes Germany into France showdown at World Cup
- 29/06/2014 Brazil, Colombia to clash for World Cup semifinal spot
- 29/06/2014 Brazil beats Chile in shootout at World Cup
- 29/06/2014 Brazil beats Chile in shootout at World Cup
- 28/06/2014 Uruguay Suarez denies deliberately biting Italy defender
- 27/06/2014 Russia packs home after 1-1 draw with Algeria at 2014 World Cup
- 26/06/2014 World Cup: USA 0-1 Germany
- 26/06/2014 Suarez banned for 4 months, 9 matches over biting
- 26/06/2014 France wins group after playing to scoreless draw with Ecuador
- 26/06/2014 World Cup 2014: Bosnia Defeats Iran, 3-1
- 26/06/2014 World Cup 2014: Argentina Defeats Nigeria, 3-2
- 25/06/2014 Greece 2-1 Côte d'Ivoire: Samaras penalty at the death sends Greeks through
- 25/06/2014 World Cup 2014: Colombia Defeats Japan, 4-1
- 25/06/2014 Costa Rica tops group after 0-0 draw with England