PHOENIX (AP) -- Eric Byrnes lined out to left field in his first at-bat Friday night and finally felt good about his swing.
Byrnes homered in the fifth -- his first since April 21 -- and added a run-scoring single during the Diamondbacks' decisive three-run seventh to finish 2-for-3.
"It's nice to contribute," Byrnes said. "We've been winning games, which has made it a lot easier going through a prolonged slump like that. I'm fortunate to have a supportive manager and supportive teammates. But it was a rough few weeks. I'm not going to lie about that."
In his first at-bat, Byrnes hit two line drives foul down the left-field line before hitting a third liner that Gary Sheffield caught.
"I really didn't care what the results were," Byrnes said. "I just felt I was going to have a good day at the plate. It's a feeling I haven't had in a while."
Haren (5-2) scattered six hits and allowed three runs for the Diamondbacks, who came back from a 3-1 deficit with three runs in the seventh en route to their fourth straight victory. They scored the go-ahead run on a two-out throwing error by third baseman Carlos Guillen.
Haren struck out four and did not walk a batter for the second time this season.
"We got contributions from everyone in the bullpen on a night we didn't have our top guys available," Diamondbacks manager Bob Melvin said.
Byrnes, mired in a 6-for-62 slump entering the game and benched after an 0-for-8 start to the homestand, greeted Miner with a sharp single to left, scoring Upton to cut the Tigers' lead to 3-2.
"No excuses," Miner said. "I fell behind Young there and got myself back into the count. I threw not too bad of a pitch out there but 3-2 he's obviously looking for a heater. I should have gotten ahead of him."
Bobby Seay came on for Miner and got Stephen Drew to hit a grounder to third, but Guillen's throw to first was low and wide and skipped past Cabrera for an error, allowing Ojeda to score for a 4-3 Arizona lead.
"We didn't play right," Guillen said. "How do you expect to win if you don't play right?"
Upton's walk came after his foul popup down the left-field line fell untouched with three Detroit players within a foot of the ball.
"We gave them extra outs," Tigers manager Jim Leyland said. "The one [Guillen's throw] is a physical error and I'm OK with that. But I'm not OK with the popup. We work on that all of spring training -- call it three times, 'I got it, I got it, I got it.' No one called the ball."
Detroit extended the lead to 3-0 in the fourth when Ordonez singled with one out and Cabrera followed with his home run into the left-field stands, his first RBIs in 13 games.
Byrnes homered with two outs in the fifth to make it 3-1.
"I dug us a little hole but I think I did a good job of keeping us there," Haren said. "Any more runs and we might have been in trouble."
Arizona's regular closer, Brandon Lyon, stayed in the bullpen after pitching the past three days. ... Pena's last save was Sept. 10 at San Francisco. ... Byrnes' home run was his first since April 21. ... Cabrera's homer was his first since May 1 at Yankee Stadium. ... Sheffield's move to DH was interrupted after just one game, courtesy of National League rules. Sheffield, who has battled a sore right shoulder all season, started in left field for Detroit and played six innings before taking the rest of the night off. ... Upton threw out Ordonez at second base when he tried stretching a single into a double. Upton's three outfield assists lead the Diamondbacks.