PITTSBURGH, Aug. 5 (UPI) -- Stephen Drew put Arizona in front with a two-run single in the eighth Wednesday, helping the Diamondbacks rally to a 4-3 win over Pittsburgh.
The Pirates took a 3-1 lead into the eighth but Arizona jumped in front thanks in large part to a throwing error by Pittsburgh reliever Joel Hanrahan.
Hanrahan (1-4) came on with the bases empty and one out in the eighth and immediately walked Ryan Roberts, who had hit a solo homer in the sixth. Chad Tracy then bounced one back to Hanrahan, whose wild throw put runners on first and second.
Evan Meek replaced Hanrahan and gave up a single to pinch-hitter Alex Romero that drove in Roberts with the tying run. A ground out by Josh Whitesell moved the runners to second and third and they both scored on Drew's single to center.
Pittsburgh could not manage a hit until the eighth in a loss to Arizona Tuesday, but the Pirates took the lead Wednesday on Andy LaRoche's two-run homer in the second.
Doug Davis (6-10) lasted long enough to get the victory, going seven innings while allowing four hits and two runs. Chad Qualls gave up a ninth-inning homer to Garrett Jones, but earned his 21st save.
Arizona won its fourth in a row. The Pirates have dropped four straight.