The Dodgers loaded the bases with one out against Brad Brach (0-1) and Gordon then lined a pitch past diving San Diego third baseman Chase Headley, triggering a wild celebration as Los Angeles completed a three-game sweep of the Padres.
Javy Guerra (1-0) earned the victory with a scoreless top of the ninth, which was highlighted by a controversial triple play.
The Padres had put runners at first and second with no outs when Jesus Guzman squared to bunt. He backed out of the way of an inside pitch, but it hit his bat and went straight down.
Catcher A.J. Ellis picked it up and fired to third base for the first out, and the Dodgers sent it around the horn as the Padres protested the bunt had been foul.
Manager Bud Black argued the call and was thrown out by home plate umpire Dale Scott.
Matt Kemp went 3-for-4 and hit his MLB-best sixth homer for Los Angeles.
Jeremy Hermida drove in two runs for San Diego.