The rookie from Canada allowed one hit in seven impressive innings for his second career win, and the Philadelphia Phillies halted New York's four-game winning streak with a 7-1 victory Sunday.
"My arm felt really, really good today, which was nice. I felt really confident going into the game," Pivetta said. "Just had fun, you know?"
Maikel Franco hit a two-run double in a four-run second aided by a pair of sacrifice bunts. Rookie catcher Andrew Knapp added an RBI single and dashed home from second on a wild pitch by Rafael Montero.
Leadoff man Daniel Nava had three hits and two RBI to help the major league-worst Phillies (27-53) finish their 4-5 road trip on a positive note. Philadelphia outhit the Mets 12-2 and improved to 15-32 against them since the start of the 2015 season.
But the highlight was Pivetta.
"He had everything working today. I was really happy with the way he attacked these guys," Knapp said. "It's a tough lineup and you can get a little intimidated by some of the names in that lineup, but he went and attacked a lot of guys with his fastball and got ahead of a lot of hitters. That helped him a lot."
Making his 10th big league start, Pivetta (2-4) permitted only T.J. Rivera's home run on an 81 mph slider with one out in the fifth. The 6-foot-5 right-hander, obtained from the Nationals in a July 2015 trade for closer Jonathan Papelbon, struck out four and walked four.
"I think he still needs work on his secondary pitches, but once he hones those pitches, he's got a chance to be really good. I really like him," Phillies manager Pete Mackanin said . "He certainly showed that he learned something from his last outing."
Pivetta was coming off the worst performance of his brief career, when he gave up six runs, seven hits and five walks over 2 2/3 innings last Monday in a 6-1 defeat at Arizona.
"That was my No. 1 focus, is a rebound right there," Pivetta said. "I just had an off outing last time."
New York had won seven of eight since getting swept in four games at Dodger Stadium. But the Mets (38-43) played a haphazard game Sunday heading into a three-game series at NL East-leading Washington.
"We've got our work cut out for us, but there's no reason why we can't be optimistic and think you're going to have a good second half because our pitching's starting to come around and Yoenis Cespedes is not going to continue to struggle," manager Terry Collins said.
After a sacrifice by Pivetta, Montero (1-5) threw a wild pitch that ricocheted off the foot of plate umpire Ramon De Jesus and bounced away. Mets catcher Rene Rivera had no idea where the ball went, and Knapp never broke stride as he rounded third.
"I called a changeup. He threw a curveball," Rivera said.
By the time he tracked down the ball near the Phillies' on-deck circle, Knapp was sliding home ahead of an off-target throw.
"When you're not the fastest guy, you've got to go hard all the time," Knapp said. "The way we're playing, we need all the bases we can get."
A replay reversal and some clumsy defense helped Philadelphia score three times in the eighth off Chase Bradford. Pinch-hitter Brock Stassi had a two-out RBI single, and Nava followed with a two-run single.
Once a well-regarded prospect, Montero has mostly struggled in the majors. But he lasted a season-high 6 1/3 innings Sunday and has 21 strikeouts with a 2.89 ERA in four games (two starts) since being recalled June 14.
Phillies: Slumping CF Odubel Herrera was rested in favor of Nava. ... RHP Vince Velasquez allowed one run over two innings Saturday night during his first rehab outing for Triple-A Lehigh Valley. Velasquez has been on the DL since May 31 with a right elbow flexor strain. ... LF-2B Howie Kendrick, on the 10-day DL with a strained left hamstring, is scheduled for an MRI on Monday.
Mets: Hot-hitting CF Curtis Granderson sat out with a stiff hip and is day to day. He was replaced by Brandon Nimmo, who batted leadoff in his first major league start this season. ... Collins said closer Addison Reed was unavailable after saving three straight games.
Phillies: A seven-game homestand leading into the All-Star break begins with four against Pittsburgh. RHP Aaron Nola (5-5, 4.13 ERA) starts the opener Monday night vs. Pirates RHP Ivan Nova (8-5, 3.08).
Mets: LHP Steven Matz (2-1, 2.67 ERA) gets the ball Monday night in Washington against RHP Stephen Strasburg (9-2, 3.51). Coming off seven shutout innings at Miami, Matz is 2-0 with a 1.80 ERA in three road starts this season.
More AP baseball: https://apnews.com/tag/MLBbaseball
Fantasy baseball pitcher rankings, lineup advice for Saturday's MLB games
Everything you need to know to place your MLB bets and set your fantasy baseball lineups for Saturday, May 21.
Fantasy baseball pitcher rankings, lineup advice for Friday's MLB games
Everything you need to know to place your MLB bets and set your fantasy baseball lineups for Friday, May 20.
Fantasy baseball forecaster: Pitcher projections for the next 10 days
Keep up to date on who is pitching -- and how well they're expected to do -- with our forecaster, which provides a rolling 10-day outlook of every team's probable starting pitchers with game score projections.
Sports venues create quiet refuge for fans with sensory needs
Stadiums are adding spaces to help people with autism or ADHD, or anyone seeking to lower anxiety levels and find some calm away from the noise of the game.
$300 million as a 30-year-old? How much New York Yankees star Aaron Judge could really get in free agency
Judge is having a career year after turning down the Yankees' nine-figure extension. We break down the slugger's long-term value and which teams are most likely to pay him.
Rockies host the Mets to open 3-game series
New York Mets (26-14, first in the NL East) vs. Colorado Rockies (18-19, fourth in the NL West)