PHOENIX -- Wily Mo Pena didn't think he was going to hit a home run.
"The only thing that was on my mind was trying to make contact," he said. "And helping us win the game."
With two outs in the ninth on Tuesday night, Pena saw a hanging breaking ball from Indians reliever Tony Sipp, made contact and won the game with a walk-off home run in a 6-4 D-backs victory at Chase Field.
"Contact," Pena said. "That's what it's all about, is making contact. If you make contact, it's going to be a ground ball, home run or something, and everything will work out."
It was the second straight night Pena delivered a crucial pinch-hit and halted Arizona's three-game losing streak.
"Wily Mo Pena solved the puzzle," D-backs manager Kirk Gibson said. "It was big. It was huge for us. I was sitting there thinking about how I wanted to orchestrate this out, and he made us all look good tonight."
The home run was Pena's third since being called up from Triple-A Reno on June 21.
"I feel great," he said. "I just have to be ready any time they need me to pinch-hit, and just stay ready."
But Pena wouldn't have been in position for his second-career walk-off home run had closer J.J. Putz not allowed a home run for the second straight night in the ninth inning.
Ahead, 4-2, entering the final frame, Putz walked Orlando Cabrera on four pitches before giving up a game-tying, two-run home run to Carlos Santana, who pulled a fastball around the foul pole and over the Indians bullpen in right field.
"The ball hasn't come out of his hand well since Detroit," Gibson said. "We'll have to see what's going on with him. He hasn't thrown the ball like he has in the past, so we want to get him right, for sure."
The blown save was Putz's third of the month. In his first day with the D-backs, left-handed reliever Alberto Castillo struck out a batter in the ninth with the potential go-ahead run on second and picked up the victory.
An inning earlier, Kelly Johnson broke a 2-2 tie with a soft line drive into right field to score Gerardo Parra, who singled off reliever Rafael Perez to open the inning.
Two batters later, Justin Upton drove Johnson home to give the D-backs a 4-2 lead, and what looked to be Daniel Hudson's seventh consecutive win and 10th of the season. But the Indians tied the game in the ninth, and Hudson gained a no-decision.
"I kind of battled tonight," Hudson said. "I didn't have great command tonight, but I pushed through it."
The right-hander pitched eight innings, allowed two runs on six hits, struck out five and walked one.
Trailing, 2-0, in the fifth, he sparked the team with a two-out double into the right-field corner, scoring Parra, who tripled a batter earlier, and pushing his batting average above .300 on the season.
"I was able to help out," said Hudson, who also had two sacrifices. "I put a couple guys in scoring position, and put a good swing on a fastball."
An inning later, Johnson tied the game with a solo home run to right field off Indians starter Josh Tomlin, his 13th of the season.
Tomlin pitched seven innings, allowing two runs on five hits, while striking out four. He also recorded his first career hit on an infield single in the third, as well as his first career RBI on a single in the fifth to give Cleveland a 2-0 lead.
"Sometimes you get the American League teams in here and kind of take them for granted," Hudson said. "He just put a nice short swing on a fastball, and he hit it up the middle."
Ryan Roberts led off the ninth with a walk before stealing two bases and strolling home from third on Pena's walk-off home run against the left-handed Sipp, which came with the left-handed Johnson in the on-deck circle.
"That was the match up we liked, right there," Indians manager Manny Acta said. "Tony is a guy who gets righties and lefties out. Right-handers hit .200 against him over the last three years. We liked that match up better and, unfortunately, it didn't pay off."
Gibson's faith in Pena did, and the D-backs have the chance to win the series on Wednesday.
"That's what this team's all about, and that's what this game's all about," Roberts said, about picking up his teammate Putz. "Getting everybody's back is the main thing."
Anthony Fenech is an associate reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.