Albert Pujols tied Alex Rodriguez for second on the career RBI list with a sixth-inning single for the Angels, who have lost six of seven.
Wilmer Flores homered and drove in four runs for San Francisco. Austin Slater also went deep to help the Giants win consecutive games for only the third time this season. Mike Yastrzemski and Evan Longoria added two hits apiece.
''That was a good win,'' Giants manager Gabe Kapler said. ''Johnny pitched great and he was able to go deeper into the game for us. We asked a lot of him and he gave us a lot of pitches. We were able to hand the ball over to the bullpen and they did a nice job for us.''
Cueto, who missed most of last season recovering from Tommy John surgery, allowed four hits and took a shutout into the sixth before tiring. He got AL home run leader Mike Trout to strikeout looking but gave up an RBI single to Anthony Rendon before coming out after 5 2/3 innings.
Before Cueto fanned Trout, Kapler spoke with his pitcher on the mound.
''He came out and he asked me if I had something left and I said yeah,'' Cueto said. ''Then he goes, `OK, I'll give you two more hitters to face.' I feel good. I'm happy that I was able to win today.''
Cueto (2-0) also made a pair of solid defensive plays to help keep Shohei Ohtani hitless. Cueto chased down Ohtani after fielding a soft comebacker in the second, then grabbed another slow roller near first base and made the tag just before Ohtani reached the bag. After a short replay, the call stood.
There was no retaliation a day after Trout was buzzed by two ninth-inning fastballs near his head from San Francisco reliever Shaun Anderson. Trout flew out to center field twice and struck out twice.
Before the game, Kapler mulled whether to start Flores or Brandon Belt at first base. The first-year San Francisco skipper hasn't had much good fortune this season, but this time the move paid off.
Flores homered into the left field stands off a 3-2 pitch from Angels starter Patrick Sandoval (0-3) with two outs in the third. It came after Longoria reached on an infield single that deflected off third baseman Rendon's glove, then shortstop David Fletcher overran the ball for an error.
''Flores, I've seen him a lot, he really is very good against left-handed pitching,'' Angels manager Joe Maddon said. ''The changeup was just low-middle and the guy's just a good hitter.''
Slater added a two-run blast in the fourth.
Sandoval allowed five runs and six hits in four innings. The left-hander has not won in 13 consecutive starts, the longest streak by any Angels pitcher to begin his career.
SMOKE IN THE AIR
Kapler said the team was monitoring the Bay Area smoke and air quality from multiple nearby fires.
''We're keeping a close eye on things and we'll always make the best decision for the club,'' he said.
Batting practice before the game was optional.
The Giants recalled LHP Andrew Suarez from the alternate site and optioned OF Steven Duggar down.
Angels: SS Andrelton Simmons, who sprained his left ankle running out an infield single July 27 at Oakland, was set to do more on-field work. ''We're getting closer,'' Maddon said. ''He needs a good day today, and not have any kind of a setback in any way and he should be right on the verge.'' Simmons is still dealing with soreness in the ankle. ... C Jason Castro returned to the lineup after missing five starts because of neck stiffness.
Giants: Slater led off as designated hitter and is still a few days from playing the outfield as he continues to work back from a strained right elbow. . RHP Sam Coonrod (right lat strain) pitched in Sacramento and reached 100 mph and will likely make at least one more appearance.
San Francisco RHP Kevin Gausman (0-1, 4.21) makes his fifth straight start Thursday after beginning the season in the bullpen. LHP Jose Suarez (0-0, 0.00) will make his season debut for the Angels.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP-Sports
Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.