Niese pitched eight sharp innings for his first victory since May 9, and the Mets beat the San Francisco Giants 3-0 to hand the slumping World Series champions their seventh straight defeat.
"Guys persevered today," Niese said. "They pushed some runs across. It was a good feeling."
Johnny Monell snapped a scoreless tie with a two-run double in the ninth against his former team.
"It just felt great to be able to come through for the team," Monell said. "When he pitches that well he deserves to win."
Michael Cuddyer had two hits, including a single that started the winning rally, to help the Mets improve to 3-1 on a six-game West Coast trip.
It was New York's second consecutive shutout, including an 8-0 victory Sunday at Dodger Stadium behind rookie Steven Matz.
"We don't play well on the West Coast, so to get off to a great start on this road trip is huge for us," Mets manager Terry Collins said. "It looks like we're starting to get some breaks."
Niese (4-8) retired 15 of his first 16 batters before running into a little bit of trouble in the sixth, when he lost his command momentarily. The Giants loaded the bases with two outs on Joaquin Arias' single and walks to Ehire Adrianza and Matt Duffy.
Niese retired All-Star slugger Buster Posey on a grounder to third to end the threat.
"I lost my feel for everything for a few batters," Niese said. "I wanted to slow the game down and stay calm to pitch against Posey."
The left-hander did not permit a run for the first time all season, ending a six-game losing streak and a nine-start winless streak. He allowed three hits, walked two and struck out four.
"He deserved it a lot," Collins said. "He's been pitching well lately and he had another tremendous outing."
Chris Heston, facing the Mets for the first time since throwing a no-hitter against them on June 9 in New York, gave up three hits in 7 1/3 shutout innings. He walked four and struck out two.
"I wish I would have not walked so many people and just tighten the zone a little better," Heston said. "But other than that I thought it went pretty well."
Cuddyer singled off Sergio Romo (0-4) to start the ninth and went to third on a double by Kirk Nieuwenhuis, called up from the minors before the game. Monell doubled against Santiago Casilla to drive in the go-ahead runs.
Heston was pulled after hitting Lagares with a pitch and walking Ruben Tejada sandwiched around a forceout on a ball that fell amid three players in short left field. Gregor Blanco threw to second to force Lagares.
Mets: Right-handed reliever Jenrry Mejia made his final rehab appearance Sunday and is expected to be activated in time for Tuesday night's game. Mejia completed his 80-game suspension for testing positive for performance-enhancing drugs.
Giants: OF Hunter Pence (soreness in left wrist) took batting practice the past two days, and manager Bruce Bochy said Pence could return this week.
Mets: RHP Bartolo Colon (9-6, 4.55 ERA) threw seven shutout innings in his last start. Colon is 2-2 with a 5.46 ERA in five starts against the Giants. He has not won in San Francisco in three years.
Giants: RHP Matt Cain (0-1, 9.00) will make his second start of the season Tuesday night. He made his first start in nearly a year on Thursday, taking the loss against Miami. Cain is winless in his last four starts against the Mets and is looking for his first win against them in four years.
The next MLB superstar? Yankees' Gleyber Torres is ready to own his moment
The Yankees shortstop who is uncommonly wise for a 23-year-old and motivated by the hope of creating a better life for his parents could be baseball's next big thing.
MLB experts predict: Answering biggest questions ahead of 2020 season
Which squad could be this year's big surprise? Which top team from last season could be in for a disappointing 2020? Our crew of insiders weighs in.
Buster Olney's top 10 right fielders: Acuna, Betts, Harper, Judge, Yelich ... oh my!
Five guys who could all end up in the Hall of Fame. Ranking them? Brutal.
Texas Rangers' Robinson Chirinos could miss season start with ankle injury
Texas Rangers catcher Robinson Chirinos could miss the start of the season because of an injured right ankle sustained in an intrasquad game.
Mets' Jacob deGrom leaves intrasquad start with back tightness
Mets ace Jacob deGrom left Tuesday's intrasquad start after just one inning because of tightness in his back.
Tyler Glasnow back with Rays after testing positive for coronavirus
Pitcher Tyler Glasnow rejoined the Rays for a simulated game Tuesday, 11 days after he tested positive for the coronavirus.