Nimmo raised his on-base percentage to .450, best in the majors among players with at least 100 plate appearances, with a career-high four hits and a walk. He had a triple and two doubles, and Asdrubal Cabrera and Wilmer Flores each added two RBIs.
Matz (2-3) matched his longest outing of the season in the opener of a four-game series. Both of his victories this season have come against the NL Central-leading Brewers.
The Mets got on the board first in the third when Nimmo tripled off starter Zach Davies (2-4) and scored on Flores' sacrifice fly.
New York extended the lead to 3-0 in the fifth on Cabrera's two-run double, which chased Davies, who was returning from a monthlong stint on the disabled list due to right rotator cuff inflammation. The Mets added another run in the inning on Flores' run-scoring single off reliever Dan Jennings.
Davies gave up four runs and six hits in four innings. He struck out two and walked two in the shortest outing of his seven starts this season.
Devin Mesoraco drove in a run with a double in the seventh off Jorge Lopez to extend the margin to 5-0.
Matz gave up four hits while striking out two batters and walking two. He threw 94 pitches, one off his season high.
Mets' relievers Paul Sewald and Jacob Rhame combined for three scoreless innings to complete the shutout.
The Brewers were held without a hit from the fifth inning until Hernan Perez led off the ninth with a single.
Mets: OF Juan Lagares had surgery Wednesday in Manhattan to repair a complete tear of the left big toe plantar plate. ... C Kevin Plawecki (broken left hand) and RHP Hansel Robles (sprained right knee) continued rehab assignments at Triple-A Las Vegas.
Brewers: Ryan Braun was re-instated from the disabled list and started in left field. He had a single in four at-bats. ... 3B Travis Shaw got the night off. Hernan Perez started in his place.
Mets: Noah Syndergaard (4-1, 2.91 ERA) is 2-0 with a 0.49 ERA in three career starts versus the Brewers. He struck out eight consecutive Milwaukee batters in an April 15 start.
Brewers: Junior Guerra (3-3, 2.98) is 1-0 with a 0.71 ERA in two career starts against the Mets.
More AP baseball: https://apnews.com/tag/MLBbaseball