PHOENIX — Greg Holland might be in a rut.

Allowing an earned run for the third consecutive game might have put the Arizona Diamondbacks closer in an even tougher position. Luckily for the D-backs, his teammates were there to prop him up.

Holland tee’d up Braves third baseman Josh Donaldson for a home run with no outs in the top of the ninth inning on Thursday at Chase Field, and a 1-1 stalemate turned into a 2-1 Atlanta lead. But it didn’t hold.

Diamondbacks outfielder David Peralta ripped a Luke Jackson pitch over the right-field wall with two outs in the bottom of the ninth, tying the game at 2-2 and leading to extras. Arizona just needed a 10th-inning walk of Nick Ahmed and single by Carson Kelly with no outs set up a Ketel Marte pinch-hit walk-off that fell between three Braves.

“We fought back a little bit in the last inning,” Peralta said of the 3-2 win at Chase Field. “We always back each other. Holland’s been doing a great job, and I told him, ‘Don’t worry … we got your back.’”

The D-backs edged Atlanta on a night when two up-and-coming arms matched one another blow-for-blow. Atlanta 21-year-old Mike Soroka allowed one run in 6.0 innings, while Arizona 25-year-old Luke Weaver went 7.0 frames, striking out six while also allowing a run.

Weaver was rolling through most of it. And then for the last few innings of service, he was fuming.

Just when the Braves caught wind of what the Diamondbacks starter was trying to do, just as his stuff started to get hit with stronger contact, Arizona’s outfielders were behind him. Just like they were behind Holland.

Right fielder Adam Jones reeled in a would-be two-run homer by Ronald Acuna Jr. to end the top of the sixth, leaving a clearly perturbed Weaver grateful after his 89th pitch.

“Jonesy was just so nonchalant out there,” Weaver said. “I thought maybe it was just a flyout at the warning track and then all of a sudden he hopped up like he was in BP or something and was just trying to look cool for the teammates.

“Let the record show, my facial expression was not all that great. I am mad at myself for that but I was just more in shock.”

With Weaver’s 92nd pitch, Peralta made a diving catch on his belly on a Nick Markakis liner before Atlanta’s Dansby Swanson popped out to shallow right as Jones streaked in to make another out.

Jones needed to retreat to the fence once again for the third out of the seventh.

“We won that game because of our defense,” Weaver said.

Through it all, the D-backs and the Braves were still tied, 1-1.

Weaver allowed three hits in his second seven-inning outing in a row, tying a season-high after he went the same length in his last game against the Colorado Rockies. It was especially crucial after the Arizona bullpen got worn down a day prior during a 13-inning win over the Tampa Bay Rays that ate through seven relievers.

The games on Wednesday and Thursday marked the first time since August 2013 that Arizona had played in back-to-back games of extra frames.

On Thursday, Arizona opened the day’s scoring when Christian Walker’s first career triple bounced into the far-right-field corner nook. A groundout RBI by Wilmer Flores gave Arizona a 1-0 lead in the bottom of the second inning.

Former D-back Ender Inciarte took first base in the top of the third inning on a hit-by-pitch and gave the Braves their first run on a rocket of an Ozzie Albies double that hit off the center-field wall, tying the game, 1-1.

Both teams went scoreless until Donaldson smacked Holland’s slider in the ninth.

“I know the other outings have not been pristine, but that’s to be expected,” Lovullo said of Holland. “We feel good about his outings and we know that they haven’t been perfect but minimal concern for me.”

Arizona, at 22-16, has earned the right not to panic about Holland’s recent play or otherwise. So far, the D-backs are not letting one or two bad moments within a game doom them.

“There were so many moments where guys just kinda said, ‘You take it,’ hand it off to the next guy, ‘I’ll set it up the best way I can,’” Lovullo said. “We put the bat down and had good at-bats, put the bat down and took our walks.

“It was a complete day. It would’ve been frustrating to lose this game.”