MINNEAPOLIS >> The good times kept rolling Tuesday for the Giants, who won for the seventh time in eight games, beating the Minnesota Twins 4-3.

Alex Cobb overcame a pair of home runs, and Michael Conforto provided a crucial one of his own in the seventh inning as San Francisco (24-24) evened its record, pulling to .500 for the first time since the sixth game of the season.

Camilo Doval closed it out for his National League-leading 13th save.

The pitching matchup pitted Cobb, the NL ERA leader, against the hurler with the lowest ERA in the American League, Minnesota’s Sonny Gray.

While Gray was the only starter to emerge still holding the crown, the Giants chased him in the sixth inning and took the lead against the Twins’ bullpen.

Besides the two home runs — a two-run shot in the first inning from Byron Buxton and a fifth-inning solo shot off the bat of Michael A. Taylor — Cobb was efficient and completed seven innings while allowing only the three runs on the two long balls. His ERA rose from 1.94 to 2.17, second in the NL, trailing only Atlanta’s Bryce Elder (2.06).

The Giants climbed out of an early 3-0 hole, scoring the final four runs of the game with two each in the sixth and seventh innings.

Conforto golfed the go-ahead homer over the left-field wall, scoring Thairo Estrada, who led off the seventh with a double, and delivering the Giants a decisive 4-3 lead. All left fielder Willi Castro could do was give a feeble leap as the ball sailed just over the wall, landing in the gap before the first row of seats.

The homer was Conforto’s second in as many games. Six of his team-leading 10 home runs have come in 12 games since May 11.

Conforto’s batting average (.221) and OPS (.733) climbed to their highest points since the third week of April after a 2-for-4 performance Tuesday. He also doubled in the sixth, sandwiched between bases on balls to J.D. Davis and Mitch Haniger, Gray’s only free passes of the game.

The Twins bullpen nearly walked a highwire act in the sixth after the Giants loaded the bases with nobody out and forced Gray out of the game. Pinch-hitter Casey Schmitt popped out to shallow center and Wilmer Flores struck out. But rookie catcher Patrick Bailey watched four straight pitches below the strike zone, and fellow rookie Bryce Johnson displayed the same plate discipline with a five-pitch walk. The third and fourth walks of the inning forced in two runs, pulling the Giants within 3-2.

With the two runs credited to Gray, his ERA rose from 1.64 to 1.82 but remained the best in the AL.

With Conforto’s homer and Cobb rebounding from the two he allowed, the Giants reached their magic formula: They improved to 22-9 when scoring at least four runs and 16-3 when allowing three or fewer.

San Francisco will have Anthony DeSclafani (3-3, 3.09) on the mound against Joe Ryan (6-1, 2.25) of San Anselmo in today’s series finale as the Giants look to sweep all three games from the AL Central leaders.

Two-way prospect heads to San Jose >> Some 18 months after he underwent Tommy John surgery, Reggie Crawford, last year’s first-round pick, has been assigned to the Single-A San Jose Giants.

Barring travel complications, the 22-year-old Crawford is expected to make his debut with San Jose on Saturday, when the club is visiting Modesto. That would line him up to make his home debut the following week, hosting Fresno for five games.

Since being selected 30th overall last June, Crawford has spent the majority of his time at the club’s facilities in Arizona, building back strength in his left arm and, more recently, appearing in rehab games with their rookie ball affiliate. He underwent the elbow reconstruction procedure in October 2021, while he was still at the University of Connecticut, and made his first rehab appearance May 2, a span of nearly 18 months.

Crawford’s rehab process was slowed by a bout of mononucleosis, which knocked him off schedule by about a month.

Giants manager Gabe Kapler took a side trip to see Crawford during the team’s recent road trip to Arizona.

“The impression at first is his physicality,” Kapler said of Crawford, who stands 6-foot-4 and weighs 235 pounds. “He’s bigger and more physical than most of the players in extended spring (training), as you might imagine. I guess when he was on our field at Oracle Park, he was bigger and more physical than most of the players there, too.”

Drafted as a two-way player, with a powerful left arm and left-handed swing, Crawford will continue to pursue that path initially. In his rehab games, he has hit a ball at 101 mph and topped out at 98 mph velocity on the mound.