Updated

Mark Melancon needed one pitch to give the Houston Astros a four-game split with the NL West-leading Arizona Diamondbacks.

It didn't come.

Melancon surrendered a tying, two-run shot with two outs and two strikes in the ninth and Chris Young hit a game-ending three-run homer in the 10th and the Diamondbacks rallied from four runs down to beat the Houston Astros 8-5 on Thursday night.

"I was confident in what (catcher Humberto) Quintero and I were doing," said Melancon, who blew his fourth save in 15 tries and first since June 26. "I thought out plan was good. But I made one bad pitch and he capitalized it. The whole key in pitching is keeping the hitter off balance. Execution was what failed."

Jeff Fulchino (1-4) gave up consecutive singles to start the tenth. Sergio Escalona retired Miguel Montero on a fly ball to right before Young drove a pitch deep to left for his 17th home run of the season and sixth career game-ending homer.

"We didn't have any plan other than to get ahead of the count, make a good pitch and make the location," Escalona said. "I didn't. He hurt me. I tried to go away and I missed the spot."

J.J. Putz (2-2) pitched a scoreless 10th inning for the NL West-leading Diamondbacks, who moved a full game ahead of idle San Francisco with their third consecutive victory.

Jason Bourgeois and Jose Altuve each had three hits for Houston, which wasted a solid start by Brett Myers and lost their third straight game. Carlos Lee and J.D. Martinez had two RBIs apiece.

Bourgeois helped the Astros take a 5-1 lead in the seventh when he tripled under the glove of a diving Upton in right and scored on Altuve's third single of the night.

But the Diamondbacks responded with two runs in the eighth. Roberts doubled in Willie Bloomquist and scored on Montero's bloop single to center.

Melancon struck out Kelly Johnson to start the ninth and Xavier Nady singled off third baseman Jimmy Paredes' glove. Melancon then struck out Gerardo Parra before Paul Goldschmidt homered.

Arizona starter Joe Saunders allowed the leadoff hitter to reach in four of the first five innings and it came back to haunt him in the Astros' three-run fifth.

Saunders walked Myers and Bourgeois followed with a single off the glove of a sliding Upton. Altuve reached on a bunt hit to load the bases and Martinez doubled off the left-field wall, scoring Myers and Bourgeois for a 3-0 lead.

Altuve scored when Lee lined a pitch off Saunders' glove for an RBI groundout.

Bloomquist singled in a run in the bottom half against Myers, who was charged with three runs and six hits in 7 2/3 innings.

"He battled through the whole game and really did a good job," said Astros manager Brad Mills of Myers, who is winless in 10 starts since June 17.

Myers allowed only four hits before tiring in the eighth.

"I didn't give up too many hard hit balls and a couple of bloopers cost me a couple of runs," Myers said. "They're a good hitting ballclub so you try to keep them on the ropes as much as you can by mixing pitches."

NOTES: Montero threw out two runners trying to steal second and the Astros were 1 for 4 on stolen-base attempts overall. Martinez was thrown out at home on a failed suicide squeeze attempt in the second. Martinez made the defensive play of the night when he tracked a fly ball by Roberts into foul territory in left, had his feet slide out from under him but still reached back over his head while lying prone to make the catch. ... Martinez is the first player in Astros history to hit four homers and drive in 12 runs in his first 10 career games. The Diamondbacks claimed SS Tommy Manzella off waivers from the Astros and optioned the 28-year-old to Triple-A Reno. To make room for Manzella, the Diamondbacks moved Juan Gutierrez (right shoulder inflammation) to the 60-day disabled list . RHP Ian Kennedy is scheduled to pitch for Arizona on Friday against the New York Mets. Kennedy has won six straight starts, the longest active streak in the majors. RHP Dillon Gee, the scheduled starter for the Mets, has lost four of his last six decisions.