Joc Pederson opened the game with his franchise single-season record ninth leadoff home run and Kenley Jansen closed it with his 300th career save.
It was another good night for the seven-time NL West champion Los Angeles Dodgers, who beat the San Diego Padres 6-4 Wednesday.
Pederson homered twice and drove in three runs, Edwin Rios had an impressive tiebreaking shot in the seventh inning and Chris Taylor also connected for the Dodgers, who have won three straight and four of five.
"It was a big win, and we're still playing for home-field advantage, so we need to do what we can to win some ballgames," Pederson said.
Pederson has 35 homers. It was his sixth multi-homer game of the season, 14th of his career and the 20th leadoff shot of his career. Both came off Dinelson Lamet (3-6). Pederson added a sacrifice fly in the ninth.
"He's taking good at-bats and it showed tonight," manager Dave Roberts said. "He's been consistent in the strike zone, taking good, quality at-bats."
Rios' shot off rookie David Bednar (0-1) was estimated at 473 feet, the second-longest in Petco Park history. The longest was a 479-footer by San Diego's Alex Dickerson on Sept. 9, 2016. It was Rios' fourth.
Pederson homered leading off the fifth to give Dodgers a 4-3 lead, but the Padres tied it in the sixth when Yimi Garcia hit a batter and allowed consecutive singles, including an RBI base hit by Greg Garcia.
The Dodgers regained the lead when Rios homered deep into the seats in right field leading off the seventh. It was his fourth.
Dylan Floro (5-3) got the last out of the sixth for the win. Kenley Jansen pitched the ninth for his 32nd save.
Jansen already was the Dodgers' all-time leader in saves before recording his 300th.
"Really proud of him. That's a big number," Roberts said. "Longevity helps, health, performance, all those things. Hats off to Kenley and his teammates that have gotten him to that position. We acknowledged that in the clubhouse afterward. He got his hair done so I don't know if we were going to do a beer shower."
Said Jansen: "To me what it means most is getting myself ready to get better and get to the playoffs and try to help my team win a championship. Definitely it's a blessing to get 300 saves. It's awesome."
The Dodgers took a 2-0 lead in the first on Pederson's homer and Corey Seager's two-out RBI double.
San Diego went ahead 3-2 in the bottom of the inning. Ross Stripling issued a leadoff walk to Greg Garcia and then struck out Manuel Margot and Eric Hosmer, but then ran into trouble. He allowed Wil Myers' single and Francisco Mejia's RBI double, with Myers scoring on Pederson's throwing error. Rookie Josh Naylor followed with an RBI single.
Taylor homered leading off the second, his 12th.
Stripling went three innings, allowing three runs and four hits while striking out seven and walking one.
Lamet struck out 10 in five innings while allowing four runs and six hits, with two walks.
"He was a little slow getting going," interim manager Rod Barajas said. "Kind of a theme, something he needs to be better at. He had lights-out stuff again. Ten punches in five innings, that's 24 punches in the last 11 innings. He's got electric stuff, great stuff. When you're playing a team like the Dodgers, when you make mistakes, they don't miss a whole lot of those. Still sharp, still has his stuff."
Dodgers: SS Seager left the game in the bottom of the third inning with a tight left hamstring. He was replaced by Kiké Hernandez. Roberts said Seager will take Thursday off and then return Friday night.
Dodgers: LHP Clayton Kershaw (15-5, 3.15 ERA) is scheduled to make his final start of the regular season in the series finale Thursday. He's 2-0 with a 3.12 ERA in four starts against San Diego this season.
Padres: LHP Joey Lucchesi (10-9, 4.28) is scheduled to start the Padres' home finale. It will be his team-leading 30th start, and his 10 victories are the most by a Padres starter since Jhoulys Chacin's 13 in 2017.