Javier Baez and Anthony Rizzo homered for the NL Central-leading Cubs, who have won six of seven since the All-Star break, after the Cubs overcame a three-run deficit to beat the Padres 6-5.
Manny Machado hit a home run that built a 3-0 lead.
Josh Naylor tied the score 5-5 in the eighth inning against Pedro Strop (2-3) with his first career pinch homer, but the Cubs went back ahead in the bottom half.
Rizzo singled off Craig Stammen (6-5), rookie shortstop Fernandez Tatis Jr. threw Addison Russell's grounder into center field for an error, Jason Heyward was intentionally walked and David Bote hit a grounder to third. Machado threw home for a forceout and catcher Francisco Mejia threw to first, even though he didn't have a play on Bote. The ball hit off the glove of first baseman Eric Hosmer and bounced into short right field as Rizzo scored on Hosmer's error.
Craig Kimbrel struck out three around a four-pitch walk in the ninth for his fifth save in six chances. San Diego has lost five of six and 11 of 15.
Jon Lester made his 400th big league appearance and matched his career high by allowing 12 hits, giving up four runs in six innings. He needed 26 pitches to get through the first on an afternoon with a 93-degree temperature at game time.
Padres left-hander Eric Lauer gave up four runs, five hits and three walks in 4 2/3 innings in his first appearance since July 5. Lauer had gone on bereavement leave following the death of his father.
He remained in the game after he was hit on the back by Albert Almora Jr.'s single in the third.
Hunter Renfroe hit a sacrifice fly in the first and Machado made it 3-0 in the third with his 24th homer, a two-run drive.
Rizzo's fourth career slam put Chicago ahead in the bottom half.
Mejia tied the score with an RBI double in the fifth, and Baez hit an opposite-field homer to right-center in the bottom half.
Joey Lucchesi (7-4) is scheduled to start Saturday for San Diego. Jose Quintana (7-7) has won three straight starts for the Cubs.