DETROIT — David Peralta had no intention of falling behind Detroit closer Justin Wilson in the ninth inning of Tuesday’s tie game between the Tigers and Arizona Diamondbacks.

Peralta led off and swung at Wilson’s first pitch, hitting a solo home run to left center and lifting the Diamondbacks to a 7-6 win.

“Always aggressive. That’s it, man,” said Peralta, who finished with three hits, capped by his sixth homer of the season. “I was looking for a fastball, so if he made a mistake, I’d be ready to make him pay.”

The Diamondbacks, who improved to 8-1 in interleague games, gave starter Zack Greinke a 6-0 lead in the third inning before the Tigers rallied for six runs in the sixth to tie it.

“This does show what kind of team we are. We never give up,” Peralta said. “We’re good and I think we’re showing people that.”

Arizona reliever Archie Bradley (2-1) pitched a scoreless eighth to pick up the win and Fernando Rodney had a perfect ninth for his 17th save. Greinke went 5 2/3 innings and allowed five runs, all unearned, and five hits.

“That’s what these guys do. They find ways to win games,” said Diamondbacks manager Torey Lovullo. “Although it was a very frustrating sixth inning, we caught our breath and came up big.”

Wilson (2-2) took the loss after allowing the homer to Peralta. Starter Buck Farmer went 2 1/3 innings and allowed six runs on nine hits. He was 2-0 and had gone 13 straight scoreless innings before Tuesday.

“It was location,” Tigers manager Brad Ausmus said of Farmer. “The balls that were hit out were in the middle of the plate. He wasn’t going to go through the entire season without giving up a run. It was bound to happen.”

The Diamondbacks jumped on Farmer early, scoring twice in the first inning on RBI singles by Chris Owings and Brandon Drury.

Arizona added four runs in the third on two-run homers by Paul Goldschmidt and Drury, giving the Diamondbacks a 6-0 advantage.

“For a game that looked like it was going entirely the Diamondbacks way, I thought we did a good job of turning it around,” Ausmus said.

The Tigers fought back in the sixth, with help from a throwing error on shortstop Owings, who tried to turn a double play on Alex Avila’s ground ball but threw the ball into left field. Ian Kinsler scored on the error and Avila went to second.

Miguel Cabrera followed with an RBI double, then J.D. Martinez hit a two-run homer to make it 6-4. Alex Presley and Jose Iglesias added RBI singles to tie the score.

“It was frustrating,” Greinke said of the sixth inning. “I’ve got to make good pitches. I made a bad one to J.D. Martinez and walked (Justin) Upton on some non-competitive pitches. I didn’t do the job to get out of the inning.”

IMPRESSIVE PERFORMANCE

Former Tigers closer Francisco Rodriguez, who was demoted earlier this season after struggling, showed he can still be an effective reliever in the seventh inning. After Peralta led off with a double against Tigers pitcher Chad Bell, Rodriguez entered in a 6-6 game. He struck out Goldschmidt swinging, forced a ground out from Jake Lamb and got Owings to fly out to center.

“I want to continue to get him into higher leverage situations,” Ausmus said. “We’re a lot better team when he’s pitching in those situations successfully.”

TRAINING ROOM

Diamondbacks: OF A.J. Pollock (strained right groin) will resume running bases this week and the Diamondbacks would like him to play a few minor league rehab games before rejoining the team. He has been on the DL since the middle of May.

Tigers: RHP Michael Fulmer underwent an MRI last weekend after feeling pinching in his right shoulder during his last couple starts. The MRI indicated shoulder bursitis and he received a cortisone shot. Fulmer, who played catch on Monday and Tuesday, is scheduled to start on Saturday against Tamp Bay.

UP NEXT

Diamondbacks: RHP Taijuan Walker (4-3, 3.46 ERA) is expected to be reinstated from the 10-day DL after suffering a blister on his right hand. Walker, who won his last start against the Padres on May 19, will face the Tigers in a 7:10 p.m. start on Wednesday.

Tigers: RHP Jordan Zimmermann (5-4, 5.72) is expected to start against the Diamondbacks.