PHOENIX -- The D-backs used a four-run rally in the third inning and a sixth-inning homer from Yasmany Tomas to beat the Mets, 5-4, on Tuesday night and extend New York's losing streak to six games.Zack Greinke (5-2) picked up the win, though he did not pitch as well as

PHOENIX -- The D-backs used a four-run rally in the third inning and a sixth-inning homer from Yasmany Tomas to beat the Mets, 5-4, on Tuesday night and extend New York's losing streak to six games.

Zack Greinke (5-2) picked up the win, though he did not pitch as well as he has in recent starts as he gave up four runs over 6 2/3 innings. Curtis Granderson hit a solo homer and Rene Rivera added a two-run shot off the D-backs' ace.

"We played really good I think is the main thing," Greinke said. "Just flawless defense, scored five runs, so that took care of pretty much everything. [My stuff] wasn't as good as it has been, but I thought everyone else did such a good job that it won the game for us."

The D-backs were able to get to Mets starter Tommy Milone (1-1) for four runs in the third inning, and Tomas provided what would prove to be a crucial insurance run with his eighth homer of the year.

"Sometimes you go through rough stretches like this," said Mets first baseman Lucas Duda , who blamed himself for a wide throw on Paul Goldschmidt 's steal of home in the third inning. "I think you just have to weather the storm. We have a bunch of veterans in here that can really trust ourselves and get back on track."

MOMENTS THAT MATTERED

Leaving them loaded: The second inning was not a pretty one for Greinke, who allowed a single and a double to lead off the inning. One out later, he issued back-to-back walks to force in a run and give the Mets a 1-0 lead. It appeared the Mets had him on the ropes, but they couldn't deliver the knockout blow as Greinke struck out Milone and Michael Conforto to end the threat.

"The bases-loaded situation hurt us more than probably anything," Mets manager Terry Collins said. "When you face great pitchers and you've got them on the ropes, you'd better get them. Because if you let them off, they end up putting you away. And that's kind of what happened."

Running wild: The D-backs stole a run in the third when Goldschmidt stole home as part of a double steal. With three runs already in and Goldschmidt at third, Chris Owings broke for second to steal but stopped halfway. Owings got caught in a rundown, and while he was occupying the Mets' attention, Goldschmidt scampered home. More >

"I'm just glad we were able to get a run there," Goldschmidt said.

QUOTABLE

"When things aren't going good, nothing goes good." -- Collins on the Mets' six-game losing streak

SOUND SMART WITH YOUR FRIENDS

A career .213 hitter entering this season, Mets catcher Rivera extended his career-best hitting streak to 10 games with a two-run homer off Greinke in the seventh. Rivera is batting .421 with 11 RBIs in those 10 games, collecting multiple hits in five of them.

WHAT'S NEXT

Mets:Matt Harvey will look to turn around his season, and help the Mets avoid a winless road trip, when he returns to the mound for a 3:40 p.m. ET series finale Wednesday at Chase Field. Harvey coughed up five runs in five innings last time out in Milwaukee, in his first start since serving a three-game suspension for missing a game at Citi Field.

D-backs: The D-backs close out their three-game series with the Mets and a nine-game homestand Wednesday afternoon at 12:40 p.m. MST. Patrick Corbin gets the start for Arizona, and he's pitched well at Chase Field, going 3-1 with a 2.45 ERA in five home starts this year.

Watch every out-of-market regular-season game live on MLB.TV.