PHOENIX — The Arizona Diamondbacks were relieved to get a win against the Los Angeles Dodgers on Wednesday, not because it’s the division-leading rival in other dugout, but because the D-backs just needed a victory.

Facing inconsistency and a capable Dodgers pitching staff, the D-backs struggled offensively in the series.

They pulled out a walk-off win in the 11th inning to win 3-2 and stave off a sweep in their own ballpark. Arizona finished a six-game homestand 3-3.

“We needed this one, for sure. We needed this one,” David Peralta said. “We’ve got a day off tomorrow, we have to travel today, it’s going to be even better. The way we answered back, we battled the whole game. … It took us the 11th inning to win, but bottom-line, we won.”

The D-backs mustered three hits and one run on Monday, no runs at all on Tuesday against Hyun-Jin Ryu (who has MLB’s best ERA) and only two runs in the first 10 innings on Tuesday’s game. So perhaps no moment better epitomized the series than when Kevin Cron came to bat in the bottom of the fifth inning on Wednesday.

Cron was pinch-hitting for starting pitcher Jon Duplantier, who had thrown only 71 pitches throw five innings to that point. There was a runner on third and two outs, with the D-backs trailing 2-1.

“I wish I could’ve kept Jon in the game,” manager Torey Lovullo said “I explained that to him. I said, ‘Look, we’re going to try and win this baseball game right here in the bottom of the fifth inning. You did your job, you might have to hand it off to the bullpen.’ And he accepted that.”

Duplantier was pitching quite well, apart from the two runs he allowed that both came on a two-run home run in the third inning by Will Smith. The rookie allowed only three hits, walking one and striking out seven.

Lovullo, working with an off-day on Thursday to rest his bullpen and a runner 90 feet away from home, opted for offense over pitching, an understandable move in that situation but even more so with the context of the D-backs’ offensive struggles. Nevermind that Cron made contact but lined out at third; the decision was necessary.

“I completely understand,” Duplantier said. “I mean, shoot. Cron, come up and do some damage. I mean I thought he put a pretty good swing on there. But it wasn’t my decision by any means. I had no issue with what went down.”

Had Duplantier stayed in the game, it’s likely he would’ve gone at least another full inning. Lovullo said the rookie’s pitch limit would’ve been around 85 to 90 pitches, and Duplantier had retired nine of the last 11 hitters he had faced with four strikeouts in that span.

“I was definitely ready to go out there for another inning, mentally, physically,” Duplantier said, conceding that he is still getting used to longer outings. He had mostly been pitching a couple innings at a time until more recently.

(Photo by Christian Petersen/Getty Images)

However many innings Duplantier would work, his limiting the Dodgers to just two runs was important for setting up the bullpen and the offense to get what eventually became the walk-off victory.

Lovullo used Andrew Chafin, Yoan Lopez, Yoshi Hirano, Greg Holland, Matt Andriese and Zack Godley all for an inning apiece (noting that Godley was set to keep going for as long as he could in extras). Those six pitchers combined for no runs on four hits and two walks in six innings pitched.

“We structured it the best that way that we could, and it worked out very, very well,” Lovullo said.

The D-backs captured the winning run Eduardo Escobar led off the 11th with a triple, and Ketel Marte was intentionally walked. Peralta roped a base hit to right field to end it.

“I think everybody that is sitting in here right now that’s a fan of the Diamondbacks understands how important that game is for us, especially since we’re walking through some very lean times,” Lovullo said.

“We’ve been battling through some injuries. We send a crew out there today that gave it everything they had they did enough to win the baseball game and it was a tremendous way to finish it and it’s one of those games that you feel like will push you in a very, very positive direction.”

EXTRA BASES

–Adam Jones had an MRI Wednesday that revealed what Lovullo called a “small signal,” showing something more significant than a cramp but less significant than a tear. He is still considered day-to-day and he will not go on the IL at this point.