DENVER -- David Peralta had his hopes of making the All-Star team this year dashed, and on Tuesday night, he took his frustration out on the Rockies.

Peralta smacked a three-run homer as part of a four-run seventh inning rally that led the D-backs to a 5-3 win.

"I think that's the past," Peralta said about not being named an All-Star. "I've already turned the page on all that. There's nothing you can do. I was doing my job, having a good season and it is what it is. I'm just going to turn the page and keep helping my team to win games."

That's exactly what he did on a night when it looked like the D-backs might be lacking some energy following a 16-inning marathon game with the Padres on Sunday.

The Rockies built a 2-1 lead through six innings behind an outstanding start by Tyler Anderson . After Anderson threw 109 pitches, Rockies manager Bud Black pinch-hit for him.

"Unfortunately, for the first five innings, we looked like we were semi-sleepwalking through a couple moments," D-backs manager Torey Lovullo said.

As much as the D-backs' offense struggled against Anderson, they feasted on the bullpen. Jake McGee lasted just three batters, allowing a walk and a double before Peralta homered to right, his 16th of the year.

"It was second and third, and I was thinking if I could bounce it down and away, if he was going to hit it, he was going to hit it to an infielder and keep it second and third," said McGee, who has increased use of his slider. "But I didn't execute my pitch."

Peralta wasn't necessarily looking for a slider in that situation, but he did pick up the pitch early.

"To be honest, I saw the ball pop out of his hand," Peralta said. "I thought it was a really good pitch and tried to put a good swing. It worked this time for me."

The win was the ninth in a row for the D-backs at Coors Field, which is the longest win streak by an opponent since Coors opened in 1995. It is also the most consecutive wins that the D-backs have had at an opponent's ballpark in franchise history.

"That's something that we don't take for granted," Lovullo said. "[The Rockies are] a quality baseball team. I know that we come up here and we're ready to play our best baseball."

For the third straight game, a D-backs starter was unable to get through five innings.

The Rockies made left-hander Patrick Corbin work, running his pitch count up early. Four D-backs relievers combined to allow just one run over the final 4 2/3 innings, with closer Brad Boxberger picking up his 22nd save.

"I thought our bullpen again was outstanding," Lovullo said. "They kind of carried us through those middle innings."

MOMENTS THAT MATTERED

Saving the day: The Rockies appeared to be on the edge of blowing the game open in the fifth. With a 2-1 lead, with a run already in, and runners at first and third with two outs, Gerardo Parra hit a deep drive to right. Steven Souza Jr. raced back and reached up to snag the ball before crashing into the fence, ending the inning and the threat.

"I think he made a great running catch at the wall," Lovullo said. "That would have knocked us out, I'm sure. It was a big blow potentially. Made a great play, had a good read on it."

SOUND SMART

Peralta's home run was projected at 445 feet, the second-longest home run he's hit since 2015, according to Statcast™.

The home run came on a hanging slider. Coming into the game, Peralta was hitting .358 against breaking pitches, which was the fourth-highest mark in the Majors.

"He's just a really gifted hitter," Lovullo said of Peralta's success against breaking balls. "He tracks spin very well and he attacks spin very well, but he's also able to hit anybody's fastball. I just think he's been extremely consistent this year."

HE SAID IT

"You have to set goals for yourself. I told [Lovullo] I had three goals: Be healthy the whole year, [make] the All-Star team and [win] a World Series championship. Well, I'm healthy. So that's good. I didn't make the All-Star Game, but there's still one more." -- Peralta, on whether making the All-Star Game had been a goal of his

UP NEXT

The D-backs take on the Rockies in the second of a three-game series Wednesday night at Coors Field at 5:40 MST. Right-hander Shelby Miller (0-3, 9.00 ERA) will make his fourth start since returning from Tommy John surgery. Last time out against the Padres was the best of his three starts this year, as he allowed three earned runs over 5 1/3 innings. The Rockies will counter with German Marquez (7-8, 4.92 ERA).

Steve Gilbert has covered the D-backs for MLB.com since 2001. Follow him on Twitter @SteveGilbertMLB.