The Sox led 1-0 heading into the ninth after Daniel Nava's solo shot had backed eight shut-out innings from Felix Doubront, but Kelly Johnson went yard off closer Andrew Bailey to tie the game up.
Gomes then belted a two-run shot over the Green Monster to give Boston their second win of a long day.
Earlier David Ortiz had driven in three on two hits as Boston won the day game, which was punctuated by a three-hour rain break, 5-1.
Zack Wheeler pitched six scoreless innings in his MLB debut to help the New York Mets beat the Atlanta Braves 6-1 and sweep their double-header.
Wheeler struck out seven and walked five, scattering four hits, while Anthony Recker led the offence, driving in two on a pair of hits including a home run.
Earlier, Matt Harvey had fanned a career-high 13 in seven-plus innings as the Mets held on for a 4-3 win in game one.
Justin Verlander tasted defeat against Baltimore for the first time as home runs from J.J. Hardy hit a two-run homer and Adam Jones gave the Orioles a 5-2 win over the Detroit Tigers.
The Orioles had failed to beat Verlander in 12 previous attempts, but this time it was Zach Britton who came away with the win from 5 1/3 innings of one-run ball.
Edwin Encarnacion hit a two-run homer to help the Toronto Blue Jays stretch their winning streak to seven games with an 8-3 victory over the Colorado Rockies.
JP Arencibia and Maicer Izturis hit back-to-back solo shots in the sixth to pad the Jays' lead.
Pedro Alvarez drove in a pair as the Pittsburgh Pirates beat the Cincinnati Reds 4-0, handing Mat Latos his first regular-season defeat since August.
Cliff Lee punched out nine in eight innings of two-run ball to help the Philadelphia Phillies see off the Washington Nationals 4-2.
Ryan Sweeney and Cody Ransom went back to back as the Chicago Cubs got all their runs on the board in the first inning of their 4-2 win over the St Louis Cardinals.
Matt Dominguez hit a grand slam as the Houston Astros eased to a 10-1 win over the Milwaukee Brewers.
Paul Goldschmidt homered in the ninth to help the Arizona Diamondbacks to a 3-2 win over the Miami Marlins.
Brandon Moss and John Jaso went yard as the Oakland Athletics beat the Texas Rangers 6-2, while the San Francisco Giants edged out the San Diego Padres 5-4.
The Cleveland Indians beat the Kansas City Royals 4-3, the Minnesota Twins were 7-5 winners over the Chicago White Sox and the Seattle Mariners overcame the Los Angeles Angels 3-2 in 10 innings.
The game between the New York Yankees and the Los Angeles Dodgers was postponed.