PHOENIX (AP) -- Andy Marte had not been in the major leagues since 2010, nearly a four-year span that included one year out of the game and time in the independent leagues.
The 30-year-old was called up from Triple-A Reno on Thursday to help fill the roster spots vacated by the trades of Gerardo Parra and Martin Prado and broke a tie with a two-run, pinch-hit homer in the sixth inning to help the Arizona Diamondbacks beat the Pittsburgh Pirates 7-4.
Aaron Hill added a solo shot one out later, and Nick Ahmed hit the Diamondbacks' third home run, an eighth-inning blast that was the first of his major-league career.
Marte became the eighth player in Diamondbacks history to homer in his first at-bat with the club. His last home run came in September of 2010.
''It feels great to be back,'' Marte said. ''I worked really hard to try to prove that I could still play here.''
Reliever Oliver Perez (2-1) earned the win by getting the last two outs in the sixth.
The Pirates took the lead in the second inning when Russell Martin drove in two with a double off the left field wall, but Arizona starter Josh Collmenter was able to escape further damage.
Collmenter played a part in allowing the Diamondbacks to tie the score after Jeff Locke (2-3) held them scoreless the first three innings of the game. With the bases loaded and two out in the fourth, Collmenter hit a bouncer to third baseman Pedro Alvarez, who charged the ball, scooped it and pumped once before throwing to first base.
The throw was low, but first baseman Ike Davis mishandled the catch for an error that allowed Mark Trumbo and Jordan Pacheco to score and tie the game at 2.
''''He has played a lot of first base,'' Pirates manager Clint Hurdle said of Davis. ''He has caught that one before. Nobody felt worse about it than he did.''
Neil Walker hit his 16th homer for the Pirates.
After home runs from Marte and Hill, Andrew McCutchen drove in Gregory Polanco with a single in the seventh, but the Pirates couldn't rally against Arizona relievers Brad Ziegler and Addison Reed. Reed earned his 27th save of the season with a scoreless ninth inning.
GIBBY'S BIG DAY
Gibson walked into the media interview room for his postgame comments soaked from a beer shower with silly string hanging off the back of his jersey. His players celebrated the 338th managerial win of Gibson's career, which put him No. 1 among all Diamondbacks managers in career wins. Thursday's win vaulted Gibson past Bob Melvin to the top of the list.
''It means we've got a long way to go, and we'd like to do those types of celebrations with a world championship,'' Gibson said. ''It was an interesting day today. Tough day for us all, and to kind of cap it off that way, it's certainly a day I'll remember.''
''COLL'' YOUR JETS
Collmenter slammed his cap on the dugout bench upon being removed from the game after 5 1/3 innings and Walker's home run. ''I didn't make some pitches early on, struggled,'' he said. ''I kind of had a feeling he was looking for first pitch curveball anyway, but stuck with it and should have thrown something different.''
Former third baseman Eric Chavez spoke for the last time as a player after he officially announced his retirement on Wednesday. ''Just loved the opportunity to win, and we were able to do that for most of my time in Oakland and New York,'' the 17-year veteran and six-time Gold Glove winner said. ''I don't want to say it was a tough decision. I don't plan on leaving the game forever. I'm going to take a little break and jump back into it the first opportunity I have.''
Diamondbacks: Left-hander Vidal Nuno (0-2) starts the second game of the four-game series Friday. Nuno will be making his fifth start of the season and has a 3.47 earned-run average. It will be his second career start against Pittsburgh.
Pirates: Right-hander Edinson Volquez (8-7) makes his 21st start of the season. He is 3-0 in his last four road starts with a 2.05 ERA and has won four of his last five decisions.
Diamondbacks: Shortstop Chris Owings is getting close to swinging a bat and is taking ground balls. Manager Kirk Gibson said. Owings has been on the disabled list since June 29 with a left shoulder strain.
Pirates: OF Starling Marte was eligible to come off the seven-day concussion disabled list on Wednesday but has not been activated.