Kubel moved into third in the NL with his 24th and 25th home runs. He has nine career multihomer games, including hitting three July 21 against Houston. Kubel homered in the first and seventh innings to open and close the game's scoring.
After the Pirates took the lead with a three-run second, Nieves put Arizona ahead 4-3 when he homered with Johnson on base in the sixth. Nieves connected off Wandy Rodriguez (7-11) for his second home run of the season.
Claimed off waivers from Colorado on Monday, Nieves was playing for the first time since July 8. He was 2 for 4.
Rodriguez (7-11) allowed four runs on seven hits in six innings. He is winless in three starts since the Pirates acquired him from the Houston Astros for three prospects on July 24.
Pittsburgh's runs came on RBI singles by Michael McKenry and Marte and a sacrifice fly by Jordy Mercer.
NOTES: Arizona SS Willie Bloomquist was scratched from the lineup just before game time because of a stiff back. Stephen Drew took his place in the leadoff spot. ... The Diamondbacks have won 13 of their past 19 when facing a left-handed starter. ... McKenry has a nine-game hitting streak. ... Arizona had scored at least five runs 57 times, most in the NL. ... Pittsburgh continues its season-long 11-game homestand with three games against San Diego Friday through Monday. The Padres are the only NL team the Pirates have yet to play this season. ... Arizona returns home for a weekend series against the Washington Nationals â" the only three home games the Diamondbacks will play over a span of three weeks.