PHOENIX (AP) — Buster Posey doubled in the go-ahead run in the 10th inning Monday night and the San Francisco Giants escaped with an 11-8 victory over the Arizona Diamondbacks.

The Giants extended their NL West lead to 3 1/2 games over the idle Los Angeles Dodgers. But despite leading the Diamondbacks 7-1 in the fifth, it wasn’t easy.

READ MORE: Blind Youth Football Player In Modesto Scores Touchdown In Team's Win

Posey’s double scored Brandon Crawford, who was the runner at second to start the 10th. Posey then scored on Steven Duggar’s single against Miguel Aguilar (0-1) and Donovan Solano’s squeeze bunt brought in Austin Slater, who had been intentionally walked.

Jarlin Garcia (3-2) pitched two scoreless innings for the victory.

San Francisco built its lead on the strength of Alex Dickerson’s grand slam in a five-run fifth. But the Diamondbacks, who have the worst record in the big leagues at 33-74, chased San Francisco starter Anthony DeSclafani in their half of the fifth on two-run homers from pinch hitter Josh Reddick and Asdrubal Cabrera.

The Diamondbacks tied it with three runs against reliever Jay Jackson in the seventh, including Christian Walker’s two-run double.

Mike Yastrzemski and Wilmer Flores also homered for San Francisco (67-39), which has the majors’ best record and leads all teams with 161 homers.

Diamondbacks starter Taylor Widener was charged with five runs in 4 1/3 innings. Dickerson connected against reliever J.B. Bukauskas, who walked Buster Posey to force in a run before Dickerson’s blast.

The Diamondbacks scored an unearned run against DeSclafani in the third on two singles and Posey’s passed ball.

Kris Bryant, playing in his second game since being acquired from the Chicago Cubs on Friday, was 1 for 4 with an infield hit and a walk.

Bryant homered against the Astros in his debut in San Francisco on Sunday.

READ MORE: Pedestrian Suffers Serious Injuries After Being Hit By Car In Sacramento

WHAT’S LEFT

Games like Monday’s were what Diamondbacks manager Torey Lovullo was talking about before the game.

Arizona has 55 games remaining and 25 of them are against the NL West’s “Big 3” — the Giants, Dodgers and San Diego Padres. Against those teams the Diamondbacks are 6-28.

Lovullo looks at it as an opportunity particularly for his younger players to gain experience.

“We know how challenging this season has been,” Lovullo said. “There’s no better arena for evaluation. We have a chance to disrupt (the division race) and to see what our guys can do.”

HE GETS AROUND

Arizona claimed RHP Sean Poppen off waivers from the Tampa Bay Rays on Monday. The Diamondbacks are his third team of 2021 and he pitched two innings Monday night, giving up Flores’ solo home run in the sixth. Earlier this year, the Harvard product pitched in three games for Pittsburgh and one for Tampa Bay before the Rays designated him for assignment.

To make room on the roster the Diamondbacks sent RHP Stefan Crichton to Triple-A Reno.

TRAINER’S ROOM

MORE NEWS: Wildfire Smoke Returns To Region As Folsom Renaissance Faire Returns

Diamondbacks: 2B Josh Rojas (dislocated finger) is improving, Lovullo said. He took batting practice before Monday’s game and is expected to get live at-bats later in the week. “The ball was jumping off his bat,” Lovullo said. “Everything is looking more normal.”