In a series lengthened to four games because of an earlier rainout that prompted a doubleheader on Saturday, the Giants won the final two games after the clubs had split eight previous head-to-head matchups in April.
San Francisco wasted little time jumping on Dodgers starter Kenta Maeda (2-2) after the right-hander retired the first two Giants he faced.
Buster Posey got the uprising going with a double, after which Maeda walked Brandon Belt.
Longoria followed by smacking his sixth homer of the season over the fence in left-center field, giving left-hander Ty Black an early 3-0 cushion.
The Giants made it 4-0 in the third when Belt doubled home Posey, who had walked, and San Francisco's pitchers took it from there.
The Dodgers scored once in the sixth on an RBI single by Enrique Hernandez, and once in the seventh on a run-scoring single by pinch hitter Joc Pedersen.
However, Giants relievers Sam Dyson, Tony Watson and Hunter Strickland combined for three innings of two-hit, shutout relief, delivering San Francisco its third consecutive series win.
Strickland recorded his seventh save of the season with a 1-2-3 ninth.
Blach (2-3) went six-plus innings, allowing two runs and six hits. He walked one and struck out four.
Gregor Blanco had two hits for the Giants, who have won six of their last eight games.
The three RBIs ran Longoria's total to a team-leading 15.
Cody Bellinger collected a pair of hits for the Dodgers, who have lost five of six with still seven games remaining on an 11-game trip.
Bellinger and Chris Taylor had the only extra-base hits for Los Angeles, a double apiece. The Dodgers out-hit the Giants 8-6.
Maeda went six innings, allowing four runs and five hits. He walked four and struck out three.
--Field Level Media
LA Dodgers | San Francisco | |
Kenta Maeda | Player | Ty Blach |
Loss | W/L | Win |
6.0 | IP | 6.0 |
3 | Strikeouts | 4 |
5 | Hits | 6 |
6.00 | ERA | 3.00 |
LA Dodgers | San Francisco | |
Cody Bellinger | Player | Gregor Blanco |
2 | Hits | 2 |
0 | RBI | 0 |
0 | HR | 0 |
3 | TB | 4 |
1.000 | Avg | .500 |
Team | Hits | HR | TB | Avg | LOB | K | RBI | BB | SB | Errors |
LA Dodgers | 8 | 0 | 10 | .242 | 13 | 6 | 2 | 1 | 1 | 0 |
San Francisco | 6 | 1 | 13 | .214 | 11 | 5 | 4 | 5 | 0 | 0 |