CINCINNATI — Pete Alonso hit his major-league-leading 50th home run, Jacob deGrom pitched shutout ball for seven innings, and the Mets beat the Cincinnati Reds, 8-1, on Friday night.

Amed Rosario hit a two-run homer, and Jeff McNeil added a solo shot for the Mets, who opened the day three and a half games behind Milwaukee for the second National League wild card. The Brewers hosted Pittsburgh on Friday night.

Alonso is two homers shy of the Yankees star Aaron Judge’s 2017 total for the rookie record for a season. The right-handed Alonso connected on a two-run blast in the eighth inning against reliever Sal Romano, reaching for a down-and-away pitch and lining it an estimated 437 feet to right-center field. Alonso is the second rookie to reach 50 homers in a season, and he leads Cincinnati’s Eugenio Suarez by two for most in the majors this season.

The Reds intentionally walked Alonso during the Mets’ three-run ninth.

The Cincinnati rookie Aristides Aquino led off the ninth with a homer. Aquino, a midseason call-up, has 17 home runs in 49 games this season.