PITTSBURGH -- Jonathon Niese did more than merely sit back and stew after what his manager called "the worst game he's ever pitched in his life."
He worked to ensure it wouldn't happen again.
Niese (3-2) gave up five hits, struck out five and walked two, five days after matching his career high by allowing eight runs in a 14-5 loss at Toronto.
"He was upset," Mets manager Terry Collins said. "It was human nature, but the thing is, he fought back and gave us a great game today. That's what you've got to do. You've got to bounce back."
Niese has been 0-2 with a 6.00 ERA in his previous six starts. He sat down with pitching coach Dan Warthen and veteran ace Johan Santana to discuss his approach to individual hitters. He did "a lot more preparation" in leading up to facing the Pirates, who are last in the majors in runs.
"He was very effective, kept the ball down, bought some territory inside from time to time with the cutter, mixed in all his pitches," Pittsburgh manager Clint Hurdle said. "But we weren't able to put good swings on it. That was pretty obvious."
Bobby Parnell struck out Andrew McCutchen with runners on second and third to end the eighth. Frank Francisco completed the five-hitter with a perfect ninth for his third save in four days, his 12th in 14 chances this season.
New York improved to 15-6 in games decided by two runs or fewer, second in the majors behind Baltimore's 16-6. For the second straight game, the Mets scored all their runs with two outs.
Charlie Morton (2-5) lost for the fourth time in five starts, allowing three runs and eight hits in seven innings. The Pirates have lost three of four and four of six.
"It wasn't necessarily great pitching," Morton said. "Just competing."
Kirk Nieuwenhuis reached on a one-out single in the first and scored on Lucas Duda's single. Nieuwenhuis' sacrifice fly and David Wright's RBI double -- the only extra-base hit for the Mets -- made it 3-0 in the fifth.
Wright went 1 for 4, dropping his NL-leading average to .399.
"When you pitch, you can scratch out some wins but when not pitching and hitting at the same, that's a bad combination," Collins said. "David got another big hit today. As long as he's hitting we're going to score runs but we've got to get other guys in our lineup going."
Niese won for the first time since April 14. He was effective despite rarely throwing his curveball, a pitch that is typically one of his strengths.
"He was locating very well, especially two-seamer," Johnson said. "You obviously have a game plan when you go out there, but you could see in the bullpen warming up that he had a little extra life to it. You could see it was a pitch that was going to work for him so we went to it quite a bit along with the cutter and it worked out well."
Eighteen of the 23 outs Niese recorded were via a groundball or strikeout. Only four hits reached the outfield off of him, five days after he allowed four home runs.
"My mechanics were a little off, my stride was off. My balance was off," Niese said of the start in Toronto. "Everything that had to do with balance and my body was way off. I really concentrated on that in the bullpen, just to stay balanced, just to stay over the rubber."
"I knew that wasn't the best, my last outing," Niese added. "I wanted to put it behind me and just wanted to concentrate on fixing things."
Pittsburgh has scored a total of six runs in its past four defeats combined. Josh Harrison doubled for the Pirates leading off the sixth and scored on McCutchen's single. ... Pirates RHP Jason Grilli was activated from the bereavement list and LHP Jeff Locke was optioned to Triple-A Indianapolis. Grilli, whose wife's grandfather died last week, struck out the side in the eighth. ... The Mets begin a season-long 11-game homestand Thursday against San Diego. ... RHP A.J. Burnett will start for the Pirates in a series opener against the Chicago Cubs on Friday. He has allowed more than two runs in only one of six starts.