The 38-year-old Mets right-hander, reinstated from the injured list, struck out nine across six innings where he threw 68 pitches. Scherzer was pulled after six innings with a perfect game intact, with the Mets opting not to risk injury to the three-time Cy Young Award winner on his return from an oblique issue.
The win means the Mets have booked a postseason berth, guaranteed at least a spot in the National League (NL) Wild Card Game, holding a 94-55 record.
Pete Alonso's three-run homer in the fourth inning headlined five runs against NL Cy Young Award winner Corbin Burnes.
The Mets will be making only their 10th postseason appearance in the franchise's 61-season history.
"This is what you play the game for," Scherzer said. "You play to get into the postseason. There's a lot of ways for it not to work out. For us to be able to find a way to get into the postseason, that's awesome. That's what we celebrate. That's what you play the game for.
"We have a lot of things in front of us. We understand that. But you got to celebrate the good times, too."
Astros clinch fifth AL West title in six years
The Houston Astros secured the American League West title for the fifth time in the past six seasons with a 4-0 win over the Tampa Bay Rays.
Jose Altuve's leadoff home run set the tone for the Astros, while Luis Garcia gave up two hits and four walks in five innings with four strikeouts as Houston claimed their 16th shutout.
The Astros also won for the eighth time in nine games ahead of their sixth straight postseason. Houston are assured of a first-round bye in the playoffs.
Kershaw dominates Diamondbacks
Clayton Kershaw tossed down 10 strikeouts as the Los Angeles Dodgers toppled the Arizona Diamondbacks 5-2.
The Dodgers, who have already clinched the NL West, saw Joey Gallo blast a second-inning homer, before Chris Taylor's three-run blast opened up a 5-0 lead.
But Kershaw grabbed the headlines, managing to strike out at least 10 batters with no walks in a game for the 27th time in his career.