PHOENIX — With good starting pitching, all you need is one big inning offensively.

That is a formula of success the Arizona Diamondbacks leaned on in Monday’s 8-1 win over the San Francisco Giants, ripping off six runs in the sixth inning after Zac Gallen tossed his latest six-inning gem.

But first, the crucial context.

Arizona’s (76-75) win now has it one away from clinching the season tiebreaker with San Francisco (75-75), while leapfrogging the Giants in the Wild Card standings at 1.5 games back of the New York Mets (77-73). With two games left in the series and season matchup, it will be decided in this series.

It could come down to a tiebreaker with the Mets, which also very much matters inside this series. With the head-to-head record set at a tie, next up is divisional record, and the Mets are 23-23 with six games left while Arizona is now 24-20 with eight left. It is notable that New York faces the 62-88 Washington Nationals and the 70-80 Miami Marlins, a much more favorable draw than the D-backs taking on the two teams jockeying for the NL West lead, the Los Angeles Dodgers and San Diego Padres.

But we know this is where the Torey Lovullo D-backs thrive. No expectations and a chance to shock the masses. With this 25-16 push since Aug. 2 despite selling big at the trade deadline, they have unsurprisingly created the type of energy we’ve come to know with this type of team.

“They’re a very inspired group, I think they push one another but at the end of the day I think they’ve having fun out there,” Lovullo said. “They have a nice postgame celebration and I can hear the laughter from my office. I love that. I love the fact that these guys are believing in one another.”

Gallen was asked if he believed this was possible after the deadline, and paused before noting there was still the presence of a buy-in from this group and noted there are many holdovers from 2023 when the D-backs in a similar position.

“I think just the more and more that we’ve been playing pretty good, solid, well-rounded baseball for the most part, I think we’re all just becoming believers even more,” Gallen said.

Gallen was terrific, allowing two hits and a walk for one earned run with six strikeouts. The run came via a solo homer and the Giants did not get a chance to take any swings off him with a runner in scoring position.

The one blemish on Gallen’s record since August came in his previous outing (also against the Giants), and he responded nicely.

It was huge because of how the momentum of the game remain stalled out against inexperienced Giants starter Kai-Wei Teng, who entered the game with a career 8.29 ERA in 33.2 innings. He managed one run (unearned) on two hits and a walk with five strikeouts in four innings.

For only the second time across 12 appearances in the majors, Teng allowed less than two earned runs. He cruised. Arizona only mustered three at-bats with runners in scoring position off Teng, and they all came in the first inning when the first two hitters reached base. The only run came on Teng’s own error to first base on a pickoff move, scored as unearned. Only four of the 16 D-backs at-bats against Teng resulted in a ball in play leaving the infield.

Then came that sixth inning in a 1-1 ballgame.

A Corbin Carroll double preceded two walks that seemed calculated given how Gabriel Moreno and Blaze Alexander have been swinging the bat lately. Ildemaro Vargas, starting at first base where he has formed a platoon with Tim Tawa due to no healthy natural first baseman being on the roster, knocked a two-run single in between first and second. He was caught in a rundown while Alexander advanced to third.

With a Giants lefty reliever in, plus Alek Thomas’ propensity for hitting the ball on the ground for outs and having done so in both of his at-bats, Jordan Lawlar came in to pinch-hit after a double-blunder defensively on Sunday that very well could have cost the D-backs a win.

Lawlar responded the way you would hope, with a RBI double.

“That was a key moment for him,” Lovullo said.

Baseball Savant had it down as a homer in 16 of 30 parks, which would have been the first of Lawlar’s career. Catcher James McCann showed him how it was done in the next at-bat, golfing a 419-foot shot for the type of insurance that feels necessary for Arizona with its bullpen. Geraldo Perdomo later in the inning hit a RBI triple to left-center, the fourth time he reached base in yet another, “Yeah, he’s probably the MVP of this team” showing.

The bullpen took over for Gallen the last three innings, with the wonder of course being if this roller coaster was going to be one of those ones where your legs are hanging off and the thing is corkscrewing all over the place or it’s instead one of those conventional carts with no few steep drops and a more calm vibe.

Taylor Rashi opened the seventh with a walk and two balls smoked at 106 and 99 mph off the bat, both for outs. He struck out the Giants’ Patrick Bailey to end it. The eighth was quieter for Rashi with two strikeouts and a groundout. Jalen Beeks got the ninth with his own 1-2-3, a much-welcomed absence of the “no way they do it again, right?”

Perdomo added a RBI double in the eighth inning, making him a homer shy of the cycle with two walks to boot. He reached base in all five plate appearances. What a year for him.

“I’m probably like a proud dad just watching everything that he does and the success that he has,” Lovullo said. “It’s not easy to do what he’s been doing. He’s just been so consistent and so present. He’s just leading this team without knowing that he’s doing it.”

Moreno finally cooled off, going 0-for-3 with a walk. Because his bat was so hot, at .382 (13-for-34) in 10 September games with two doubles and two homers coming into Monday, he started his first ever game at designated hitter. Moreno’s streak of five straight games with two-plus hits was snapped, the longest by any D-back this year, per Stathead.

Alexander did start this one despite getting hit by a pitch on his left elbow on Sunday, one that later forced him to be pulled from that game. He went 1-for-3 with a walk.

It’s worth nothing before we go that Lawlar was only a pinch-hitter for Thomas, so despite the ability to swap Alexander to center and put Lawlar at third, the D-backs did not want him playing defense again just yet. Jorge Barrosa was instead put into center, where he made a nice running catch in the seventh.