Miguel Montero will be the first to tell you some losses hurt more than others.

"This one is going to be tough to digest," Montero said after the Arizona Diamondbacks' 6-5, 10-inning loss to the Miami Marlins on Tuesday. "We had a five-run lead in the first inning and we couldn't do anything more."

One night after giving up 12 runs on 20 hits, the Diamondbacks appeared poised to turn the tables on the Marlins. Arizona's first six hitters reached base and the Diamondbacks opened a 5-0 lead by the time Miami starter Ricky Nolasco recorded his first out.

But after that promising start, Arizona's bats went silent and the pitching gradually gave back the lead.

Staked to the early lead, Diamondbacks starter Trevor Cahill lasted only 5 1-3 innings and gave up four runs on seven hits and a walk with six strikeouts.

"He struggled the whole time," said Arizona manager Kirk Gibson. "He had a five-run lead and then he throws 34 pitches in the second inning. We needed him to get deeper."

Cahill was long gone by the time Giancarlo Stanton gave Miami its first lead with two outs in the 10th.

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 flyball to center field before Stanton looped a clean single to left with the go-ahead run.

"The pitch was low but it was over the middle," Montero said.

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.

Steve Cishek put runners on first and second in the bottom of the 10th before retiring pinch-hitter John McDonald on a grounder to shortstop for his 10th save.

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 loss was the Diamondbacks' second straight and dropped Arizona six games behind NL West-leading San Francisco.

The Marlins pounded out 15 hits and have 35 in the series' first two games.

"It's hard to win a lot of games pitching like that," Gibson said. "It's kinda the time to check yourself."

The Diamondbacks wasted little time against 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. Montero singled home Goldschmidt and Justin Upton scored on Dan Wheeler's sacrifice fly, the first out of the inning.

It was the fourth time in franchise history the first six Diamondbacks have reached safely and the 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.

Nolasco went five innings, allowing the five runs on six hits with two walks and two strikeouts.

Miami chipped away, scoring twice in the second against Cahill on an RBI single by Donovan Solano and a ground-rule double by Nolasco that one-hopped into the left field stands.

"That was a bad pitch," Montero said. "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.

"He started out pretty good but couldn't put it together, especially with two strikes," Montero said of Cahill. "He couldn't get that pitch to put guys away."

NOTES: Upton left the game before the top of the second with tightness in his left hamstring. Marlins CF Emilio Bonafacio 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 September 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-ever 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.