MILWAUKEE — If there was one thing Arizona Diamondbacks manager Torey Lovullo could smile about in the wake of a one-run loss, it was — and has been — the fight in his team.

It’s just about all the Diamondbacks have, as opportunities to make up ground in the National League wild-card race are dwindling, further compromised by a 9-8 loss to the Milwaukee Brewers on Tuesday, Aug. 26.

The Diamondbacks made one of their bigger comebacks of the season, rallying from six runs down to tie the game in the eighth inning.

But relief pitcher Juan Morillo loaded the bases, allowing two walks and a single in the bottom of the ninth. He got one out on a shallow fly ball before the Brewers’ Isaac Collins won the game with a walk-off sacrifice fly, thrilling the home crowd at American Family Field.

“There’s some things we’ve got to work on, we have to tighten some things down a little bit,” Lovullo said. “I keep saying … we’re going to come back, we’re going to do something special today. And they did. They don’t shut down, and they play hard every single day.”

Arizona (64-69) had a chance to take the lead in the top of the ninth after Corbin Carroll’s leadoff single. Carroll took second base on a fielding error in right field but was stranded at third base as former Diamondbacks closer Shelby Miller worked his way out of trouble.

In the top of the eighth, pinch hitter James McCann led off with a double, Gabriel Moreno singled and pinch hitter Ildemaro Vargas drove in McCann with a single.

Geraldo Perdomo, who had struck out three times in his first three at-bats, tied the game with a two-out base hit, but Miller came on and struck out Ketel Marte to end the inning.

“I’m happy for him and the season he’s having,” Diamondbacks outfielder Alek Thomas said of Perdomo. “He’s a special player and he comes up in big moments. I’m really happy for the way that he’s handled his business, the teammate that he’s been and also the big plays that he’s made.”

Moreno hit a three-run home run and the Diamondbacks scored three runs in the seventh inning, but they lost their third straight game and fell 7 ½ games out of a wild-card spot with only 29 games left in the regular season.

“One swing of the bat and we were right back in the game,” Lovullo said. “We’re a different team when (Moreno is) in this lineup, and he’s healthy and he’s performing.”

Diamondbacks right-hander Brandon Pfaadt has had some rough starts this season, and Tuesday against the Brewers was another one.

Pfaadt lasted a season-low 2 ⅔ innings, giving up six runs on eight hits. He threw 80 pitches.

Trailing 1-0, Pfaadt surrendered a two-run home run to William Contreras in the third inning, and with two outs, gave up a two-run double to Anthony Seigler on a sinking fly ball that Diamondbacks left fielder Jake McCarthy got his glove on but couldn’t catch.

McCarthy slid for the ball, but couldn’t squeeze it.

Blake Perkins followed with a run-scoring single, and Pfaadt’s night was over. The Brewers scored five runs in the inning.

“They’re going to come at you. They have a good game plan,” Lovullo said of the Brewers. “That’s what they’re very capable of doing. They try to go out and just beat you down, and they did that very well against Brandon.”

Brewers rookie sensation, starter Jacob Misiorowski, had 10 strikeouts through five innings, hitting 100 mph several times with pitches.

In the top of the ninth, Lovullo went with struggling Tyler Locklear as a pinch hitter instead of the more experienced Adrian Del Castillo with two outs and runners at the corners. Miller struck out Locklear.

“I was trying to take away Shelby’s split (splitter). It’s an elite pitch,” Lovullo said. “I just felt like it would be a great opportunity for him (Locklear) to get the big hit, the game-winning hit, part of his development to help us win a baseball game. I wanted to give him that opportunity.”

Perdomo has a bump on the side of his right hand, but was in the lineup on Tuesday, Aug. 26, for the team’s second game of four against the Milwaukee Brewers.

Perdomo had X-rays following the Aug. 25 game after he was hit by a pitch in the sixth inning. Those X-rays on his hand were negative for any broken bones, Diamondbacks manager Torey Lovullo said.

“He is insisting that he’s fine,” Lovullo said. “He’s in a good spot and he wants to play, and we need him to play.

“And we need him to go out there and play full throttle, and he said he’s very ready to do that.”

Perdomo has reached base two or more times in 17 games since Aug. 1. He was batting .290 going into the game on Aug. 26, leads the team in runs batted and has drawn a team-best 81 walks.

Of the 133 games the Diamondbacks have played this season, including Aug. 26, Perdomo has missed just one.

Coming up

Aug. 27: At Milwaukee, 4:40 p.m., Diamondbacks RHP Ryne Nelson (6-3, 3.63) vs. Brewers RHP Quinn Priester (11-2, 3.44).

Aug. 28: At Milwaukee, 11:10 a.m., Diamondbacks RHP Nabil Crismatt (1-0, 1.00) OR TBAvs. Brewers LHP José Quintana (10-4, 3.32).

Aug. 29: At Los Angeles, 7:10 p.m., Diamondbacks RHP Zac Gallen (9-13, 5.13) vs. Dodgers LHP Blake Snell (3-2, 1.97).

(This story has been updated to add new information.)