CHICAGO -- Jon Lester started strong Tuesday night, and with the exception of one inning, kept getting better in a complete game.
"It's a hard thing to do now, and there's always that gratification to go out there and finish it," Lester said.
He shrugged off a 65-minute rain delay before the game and struck out the side in the opening inning. Lester then allowed just four hits while striking out a season-high 10 in his first complete game this season. He didn't issue a walk.
"That's just classic stuff," Cubs manager Joe Maddon said. "He just kept getting better."
Cueto had given up just eight homers in nine starts entering Tuesday.
"To hit three home runs against a guy like Cueto, that's pretty impressive stuff," Maddon said.
The victory was the second straight for Lester (3-2), who struck out two in the ninth and is now 5-1 lifetime against San Francisco.
Cueto (4-4) allowed four runs and five hits, walked one and struck out eight in a six innings. He was slightly affected by blisters on two pitching fingers.
"That's not an excuse," he said through a translator. "I flat out had a bad game today."
The Giants (20-27) are still 8-3 in their past 11 games.
Lester, whose longest previous outings this season were two seven-inning starts, threw 99 pitches, 70 for strikes. He is now 13-2 at Wrigley Field since the start of last season and has a 12-game home winning streak.
He was the first Cubs pitcher with fewer than 100 pitches in a complete game since Carlos Zambrano on Sept. 29, 2009.
"He threw a lot more changeups than I've ever seen when facing him," Giants catcher Buster Posey said. "He's shown it in the past, but tonight he had command of it."
The complete game was the 15th of Lester's career. His last was Sept. 2, 2016, a 2-1 victory also over San Francisco.
Schwarber's seventh homer of the season opened the scoring in the first inning. The bases-empty homer to right came on a full-count pitch and landed outside the park on Sheffield Avenue for the first ball out of the park in that direction in Maddon's tenure.
"It got small fast," Maddon said.
Heyward made it 2-0 with his fourth home run with one out in the second, sending a first-pitch shot into the right field basket.
Rizzo slugged a two-run, first-pitch homer in the fourth for a 4-0 lead. His ninth homer of the season brought in Kris Bryant, who had reached on a leadoff single.
Lester gave up a second-inning hit when Schwarber missed on a diving try on Justin Ruggiano's long fly to left. He allowed three more hits in a one-run Giants fifth as Brandon Crawford doubled home Posey from second to trim the deficit to 4-1.
NOTES: The Giants, who hit three solo home runs on Monday, have hit 18 consecutive solo homers. ... Giants RHP Mark Melancon has successfully converted nine of 11 save opportunities, including his last four. ... Rehabbing Giants INF Conor Gillespie (back spasms) is 2-for-13 in four games with Triple-A Sacramento. INF Aaron Hill (right forearm strain) is 2-for-9 with two runs scored in three games with the River Cats. ... The Giants sent LHP Matt Moore (2-4, 5.37 ERA) against Cubs RHP Kyle Hendricks (3-2, 3.35 ERA) in Wednesday's game. ... Chicago 3B Kris Bryant and 1B Anthony Rizzo each have had nine career multi-homer games before their 26th birthdays, third in franchise history behind Ron Santo and Sammy Sosa (10 each). ... The Cubs are 8-0 this season when they hit three or more home runs. ... Chicago 2B Ben Zobrist's third-inning single extended his on-base streak to 21 games dating to April 28. His longest is a 23-game run in 2011.