Dillon Gee threw 6 2/3 innings of one-run ball and the New York Mets avoid a three-game sweep against the Pittsburgh Pirates with a 4-1 victory.
Gee (7-7) allowed the unearned run on five hits and a walk in his outing. He has given up two earned runs or less in seven of his last nine starts and has not lost a decision since June 17 against the Braves.
"Stuff-wise, it probably wasn't the best day," said Gee. "I just tried to throw a lot of strikes, especially after the guys went out there and got us to an early lead and set the tone against a good pitcher."
John Buck had two RBI while Marlon Byrd and Daniel Murphy drove in one run apiece for the Mets, who lost their first road series since being swept by the Marlins on May 31-June 2.
The Mets enter the All-Star break at 41-50, fourth in the NL East.
Starling Marte and Jose Tabata each had an RBI for the Pirates, who had a three-game winning streak snapped.
Starter Gerrit Cole (4-3) lasted five frames, giving up three runs on six hits and a pair of walks.
"We're not going to overthink this thing or overcook it," said Pirates manager Clint Hurdle. "His command wasn't what in needed to be to set the tone of the game."
Pittsburgh, at 56-37, owns the second-best record in the National League behind the NL Central Division-leading St. Louis Cardinals, who lead by one game.
Cole struggled in the first, giving up three runs. Eric Young hit an infield single to begin the game and David Wright singled to right two batters later. Byrd brought Young home with a ground rule double to left.
Josh Satin walked to load the bases and Buck delivered a two-run single to right to give them a 3-0 lead.
Cole kept his composure, though, and allowed just two singles -- both coming in the third -- over the rest of his outing.
Pittsburgh got on the board in the home half of that frame. Cole hit an infield single and reached second when Gee's throw to first went wide. He then scored on a ground rule double by Marte.
In the seventh, Young singled and scored on a triple to center by Murphy.
Tabata drove in a run in the eighth. With LaTroy Hawkins pitching, Jordy Mercer hit a leadoff single and Andrew McCutchen ripped a double to right, putting runners in scoring position. After Pedro Alvarez struck out, Tabata brought Mercer home with a grounder to second.
Bobby Parnell pitched the ninth and gave up one-out singles to Clint Barmes and pinch-hitter Russell Martin but got Marte and Mercer to fly out to notch his 17th save.