Updated

Ryan Roberts was the last player to make the opening-day roster for the Arizona Diamondbacks.

Now he's an important part of the most surprising team in baseball.

Roberts hit a three-run homer and the Diamondbacks earned their 33rd come-from-behind victory by beating the New York Mets 6-4 on Saturday night.

"It doesn't matter whether we're down by two or down by seven going into the ninth," Roberts said. "That just how the team's aura is. That's just what everybody's about. We're not worried about anything but the inning at hand."

Daniel Hudson (12-8) allowed four runs, two earned, and eight hits in eight innings as the Diamondbacks posted their fifth consecutive victory to remain two games ahead of second-place San Francisco in the NL West. Hudson also had a run-scoring single, his 13th RBI of the year.

Manager Kirk Gibson warned of difficult days ahead for a team not accustomed to being in a pennant race.

"We're in a good spot," he said. "Our character's yet to be determined. It looks like we've got a lot of character. It's yet to be determined. It's going to get frustrating. It's going to get much, much, much tougher, physically and mentally. But we try to keep our team in a position where we'll be able to withstand it."

J.J. Putz pitched a scoreless ninth for his 29th save in 33 attempts.

Mets starter Mike Pelfrey was hit by a line drive off the bat of Gerardo Parra leading off the fifth inning and left the game with a bruised right elbow.

D.J. Carrasco (1-3) came in and Parra moved to second on Hudson's sacrifice before Willie Bloomquist was hit by a pitch. Roberts drove the next offering over the wall in left for his 16th homer, giving the Diamondbacks a 5-4 lead.

"Really I thought he was just going to throw a first-pitch fastball and I was going to see a pitch just to see what it looked like," Roberts said. "I didn't want to be too jumpy and too anxious and do something stupid, so I was just going to actually see a pitch. He just threw a curveball and left it up and I happened to see it and I went at it."

Afterward, Pelfrey had to field questions about a story in the New York Post in which he appeared to be critical of the Mets' personnel. He said his comments were misinterpreted in an interview that he thought had been positive.

"I didn't think I said a negative thing," he said. "That is why I was shocked."

After meeting with Pelfrey before the game, manager Terry Collins agreed with his pitcher.

"It was a tough day for him," Collins said. "He came into the ballpark getting ready to pitch and he gets hammered on things he didn't expect. Then he gets hit by a line drive on one of the days he has some of his best stuff."

Hudson was coming off perhaps the worst start of his young career when he lasted just three innings against Houston, giving up seven runs — four earned — and 11 hits. The 24-year-old right-hander won for only the second time in five starts.

"It was just kind of average," he said. "I wouldn't say I had great stuff but I didn't have bad stuff either."

The Mets have lost four in a row and 10 of 13 to fall three games below .500 for the first time since June 22.

Mike Baxter had a single and RBI triple, and Pelfrey singed in a run with only his third hit in 42 at-bats this season.

Baxter's triple over the head of center fielder Chris Young in the fourth drove in Ronny Paulino from first base, then Pelfrey singled to right to make it 4-2.

The Diamondbacks jumped on Pelfrey for two runs in the first. Roberts doubled and scored on Justin Upton's single. Upton stole second, then took third on the catcher Paulino's errant throw. Miguel Montero's sacrifice fly brought Upton home.

New York quickly tied it with two unearned runs in the second.

Roberts bobbled Jason Bay's bouncer to third for an error. Baxter singled, and the runners advanced on a passed ball by Montero. Ruben Tejada's soft double down the right-field line scored both runners.

NOTES: Bay's second-inning grounder initially was ruled a base hit but the scorer changed it to an error an inning later. ... Diamondbacks rookie Paul Goldschmidt struck out four times. ... The Mets will send ex-Diamondbacks pitcher Chris Capuano to the mound Sunday to try to avoid a sweep. The Diamondbacks will counter with Jason Marquis, who is 0-2 and has allowed 15 runs in eight innings in his two starts since coming to Arizona from Washington. ... Arizona is a major league-best 61-0 when leading after eight innings.