Trailing 4-3 entering the frame, Padres starter Alex Hinshaw surrendered a leadoff walk to Chris Pennington and was pulled in favor of Joe Thatcher (0-2).
Pennington went to second on Jemile Weeks' one-out single and both runners advanced on Josh Reddick's groundout.
Luke Gregerson came into the game and promptly uncorked a wild pitch, allowing Pennington to score the tying run, and Gomes followed by belting a 3-1 pitch deep into the left-field stands for the decisive blow.
Seth Smith also homered for the Athletics, who won their fifth straight an clinched the three-game series.
Sean Doolittle (1-0) got the win despite blowing a lead in the top of the seventh. Ryan Cook tossed a 1-2-3 ninth to pick up his third save for Oakland.
Carlos Quentin knocked a two-run homer and Will Veanable drove in a pair for San Diego.
Couple mistakenly served bag of cash at McDonald's drive-thru
Exploding whale video goes viral on Internet