Brian Wilson gave up a two-run double to David Eckstein with two outs in the bottom of the 12th after Chris Denorfia and Yorvit Torrealba singled. Wilson intentionally walked Adrian Gonzalez before striking out Chase Headley for his 10th save in 11 chances.
Downs' third hit came off rookie Cesar Ramos (0-1) and scored pinch-hitter Ryan Rohlinger and Eli Whiteside, who reached on two-out singles. Eugenio Velez added an RBI single to make it 7-4.
The win allowed the Giants to avoid tying their franchise record for the longest losing streak against one opponent to open a season.
Padres reliever Joe Thatcher, who entered in the 11th inning, got the first out of the 12th before leaving with an injury. Thatcher was holding his side before Ramos replaced him.
Dan Runzler (2-0) pitched a scoreless inning for the win.
The Giants were six outs from another loss to San Diego when Andres Torres hit a two-run homer off Mike Adams, tying it at 4 in the eighth inning.
The home run, the first allowed by Adams this season in 18 1-3 innings, barely stayed fair down the right-field line. Aaron Rowand, who had three hits, was on base with a leadoff double.
San Francisco has totaled nine runs in its seven losses to the Padres this season and had not scored more than two in any one game.
The Padres won each of the previous two games by a 1-0 score with Latos getting the win both times, including Thursday at San Francisco when he pitched a one-hitter for his first career complete game. Sanchez took the loss in both games.
In the first meeting on April 20, Sanchez lost despite allowing just one hit in seven innings. It was the only hit San Diego had for the game.
Latos allowed two runs and six hits over seven innings with five strikeouts. Sanchez gave up four runs and seven hits in five innings.
He struck out seven, hit a batter with a pitch and did not issue a walk.
San Francisco scored twice against Latos in the fourth, ending his scoreless innings streak at 21. Nate Schierholtz and Whiteside had RBI singles as the Giants scored against Latos for the first time in 19 innings this season for a 2-0 lead.
It also was the first time the Padres have trailed against San Francisco this season.
San Diego scored four runs in the fifth on four straight singles to open the inning, a wild pitch and Jerry Hairston Jr.'s two-run single with two outs.