PHOENIX -- Giancarlo Stanton quit pressing at the plate Tuesday night.
"I stopped swinging so dang hard and just put the ball in play," Stanton said. "Even if you don't hit it on the barrel, just put the ball in play and something good might happen."
Gorkys Hernandez beat out an infield single to shortstop off Sam Demel (0-1), the Diamondbacks' sixth pitcher, and went to second on a sacrifice bunt. Demel intentionally walked Jose Reyes and retired Carlos Lee on a fly ball to center field before Stanton looped a clean single to left with the go-ahead run.
"That is the reason I love speed," Marlins manager Ozzie Guillen said. "Anything can happen and speed never goes into a slump."
Chad Gaudin (2-1) struck out one and walked one in the bottom of the ninth for the win, his first since April 15 against Houston.
Demel, who had been recalled earlier Tuesday to fill the roster spot vacated by the trade of shortstop Stephen Drew to Oakland on Monday, was making his first appearance of the season after going 2-2 in 34 games for Arizona in 2011.
The Marlins amassed 15 hits and have 35 in the series' first two games.
"It's hard to win a lot of games pitching like that," said Arizona manager Kirk Gibson "It's kinda the time to check yourself."
The Diamondbacks wasted little time against Marlins starter Ricky Nolasco.
Chris Young walked leading off and Aaron Hill doubled down the left-field line for a 1-0 lead. Jason Kubel singled, Paul Goldschmidt walked and Upton hit a two-run single to right. Miguel Montero had an RBI single and Dan Wheeler hit a sacrifice fly, the first out of the inning.
It was the fourth time in franchise history the first six Diamondbacks reached safely, first since July 23, 2011, against Colorado. The inning also was the Diamondbacks' third in four games in which they scored five or more runs.
"We should have won that game," Gibson said.
Nolasco, though, took control from then on. He retired the next two batters after Wheeler and allowed only three hits over his final 4 2/3 innings, facing two more than the minimum before giving way to the bullpen.
"At first, I thought we were going to get the same treatment we gave them yesterday, but that's the kind of stuff we did in the first half," Stanton said. "Early in the year we would have given up and lost 10-nothing."
Nolasco went five innings, allowing the five runs on six hits with two walks and two strikeouts.
"No matter what happens out there, I am trying not to think it's going to be a short night," Nolasco said. "I don't know the last time the team came back to win after the starting pitcher put you down five-nothing. We did a good job of fighting at-bat after at-bat, and the offense really picked up the whole team today."
"That was a bad pitch," said Montero, the Diamondbacks catcher. "The inning should have been over. Nolasco is the pitcher. You've got to get him out. He (Cahill) made a lot of mistakes."
The Marlins followed with three in the sixth when Stanton doubled and scored on a single to center by Solano. Solano advanced to second on a wild pitch, moved to third on a groundout and scored on an infield single by Hernandez against Matt Albers to pull Miami to 5-4.
Peterson then tied it with his sharp single to center.
"This one is hard to digest," Montero said.
The Marlins loaded the bases with one out in the seventh against Brad Ziegler, but the right-hander retired Rob Brantly on a force play at the plate and struck out pinch hitter Justin Ruggiano to end the inning.
Cahill lasted 5 1/3 innings, giving up four runs on seven hits. He walked one and struck out six.
"He struggled the whole time," Gibson said. "We needed him to get deeper."
Upton left the game before the top of the second with tightness in his left hamstring. Marlins CF Emilio Bonifacio left the game in the top of the second with pain in his right knee and is expected to have an MRI on Wednesday. Both players are day-to-day. ... The Diamondbacks' five first-inning runs were their most in the first frame since scoring six in a 15-2 win against San Francisco on Sept. 24. ... Marlins C John Buck, who went 4-for-5 on Monday, was given the night off. Buck is hitting .347 (17-for-49) in August after entering the month with a .168 batting average. ... Arizona LHP Tyler Skaggs will make his major league debut in the opener of the first doubleheader in Chase Field's 14-year history against LHP Wade LeBlanc. In the nightcap, RHP Jacob Turner will make his Marlins debut against LHP Wade Miley. Turner came to Miami in last month's Anibel Sanchez trade. ... Umpire Jim Joyce performed CPR on a stadium food-service employee who had a seizure before Monday's game. "I knew something was wrong," Joyce told MLB.com. "And I knew if something wasn't done, this lady could actually die in front of me. It was more instinct than anything else." Marlins bullpen coordinator Jeffrey Urgelles, a former firefighter and paramedic in the Miami-Dade County area, soon came to assist Joyce, as well as the paramedics when they arrived on the scene. The employee, Jayne Powers, was taken to a hospital and could be released later this week.