After a rough start in San Diego -- where they dropped three of four -- they eked out a 4-2 victory over the rival Los Angeles Dodgers on Monday night.
Four of the Giants' first five games have been decided by two runs or fewer; last season, they had the most such games in the majors like that.
"We had a tough weekend in San Diego and tonight we got good pitching, good defense, and timely hitting," manager Bruce Bochy said. "We're going to have a lot of close games and we have to play like this to win."
Brandon Belt hit a go-ahead, two-run double off Scott Alexander in the seventh inning to propel the Giants. He homered on the first pitch from struggling reliever Joe Kelly leading off the sixth that left San Francisco trailing 2-1.
"Home runs aren't my focus but anytime you get a good pitch to hit and get good wood on it, it feels good," he said.
Pinch-hitter Yangervis Solarte reached on an infield single to third leading off the seventh. Two outs later, Solarte scored on Pablo Sandoval's single that took one bounce off the mound and sailed into center field. Fans lustily booed Kelly (0-1).
Steven Duggar followed with a double to center, and boos again rang in Kelly's ears as he walked to the dugout after being removed.
"That's nothing," said Kelly, a World Series winner last year with the Boston Red Sox. "I played in a place where it's a lot worse."
Trailing 4-2 in the ninth, Dodgers pinch-hitter Max Muncy walked. But Cody Bellinger and Chris Taylor struck out to end the game, wasting a stellar start from young left-hander Julio Urias.
"He was fantastic," raved Dodgers manager Dave Roberts about Urias. "He had command of all his pitches, got ahead of guys. It was fun to watch."
Trevor Gott (1-0) earned the victory and Will Smith recorded his second save.
Kelly has proven disappointing in his first two outings. He signed a $25 million, three-year deal to come over from the Red Sox in December after not allowing a run in five World Series appearances against the Dodgers last fall.
The right-hander gave up three hits, two earned runs, and a walk in 1 1/3 innings against Arizona in his debut Friday.
"Two really, really horse crap outings, results-wise," Kelly said. "The key for me is pitching with the proper mechanics, which I think is there. Everything is coming out crisp. The results will come."
Giants third baseman Evan Longoria went 0 for 4 with a strikeout in his return after a sore left calf kept him out Sunday against San Diego.
Taylor and pinch-hitter Alex Verdugo homered in the fifth to give the Dodgers a 2-0 lead. Their power surge carried over from a season-opening series against Arizona in which they smashed 14 homers.
The Dodgers were limited to a trio of singles over the first four innings before Taylor and Verdugo homered off Drew Pomeranz in his Giants' debut to give the Dodgers a 2-0 lead.
For Taylor, it was his first hit of the season after going 0 for 9 against the Diamondbacks.
One out later, Verdugo stroked his second career pinch-hit homer into center field. He came in for Urias, who made his first start in nearly two years with Clayton Kershaw and Rich Hill on the injured list.
Urias allowed three hits over five innings and struck out seven. The 22-year-old spent most of last season recovering from left shoulder surgery.
"I felt really confident and comfortable," Urias said through a translator. "Everything was working really well."
Pomeranz gave up two runs and six hits in five innings. The left-hander struck out six and walked one while falling to 1-5 in eight career appearances against the Dodgers. He faced them for the first time since 2016.
"I was amped up when the game started and was throwing hard," he said. "I was excited to be out there. I was maybe a little too pumped up because my pitches were missing a little bit early on but I settled myself down."
Dodgers: Kershaw (shoulder inflammation) will make a minor league rehab start in Oklahoma City on Thursday. After that, the left-hander and the team will decide whether he needs one more start before returning to the majors.
The Dodgers have homered in all five games to start the season, the first time they've done so since 2003.
Madison Bumgarner (0-1, 2.57 ERA) takes the mound for the Giants against fellow lefty Hyun-Jin Ryu (1-0, 1.50) in the middle game of the series.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Friedman and Zaidi laugh about relationship
Dodgers and Giants Presidents of Baseball Operations Andrew Friedman and Farhan Zaidi discuss their relationship when they worked together for the Dodgers.