Darryl Strawberry had held the Mets' record for home runs by a rookie since he hit 26 in 1983. He was the National League Rookie of the Year that season and hit his 26 home runs in 122 games. Alonso hit his 27th home run in just his 77th game.
"Congrats to Pete for breaking my record which has stood for a long time. What he's done in a short period of time is most impressive. No goal seems out of reach. I wish Pete and [the] Mets all the best the rest of [the] year," Strawberry said in a statement released by the team.
Alonso's record-setting home run had an exit velocity of 110.0 mph, his 11th homer of the season with a 110-plus mph exit velocity, according to Statcast data. That's one shy of the New York Yankees' Gary Sanchez, who leads baseball with 12 such home runs this season.
Alonso had set the NL mark for home runs before the All-Star break with his 26th on Saturday. Mark McGwire holds the major league record for homers before the All-Star break with 33 for the Oakland Athletics in 1987.
Alonso's 27 home runs are tied with Dave Kingman (1976) for most in Mets history before July 1.
The Cubs won Sunday's game 5-3 on a milestone three-run home run by Javier Baez in the bottom of the eighth inning. The homer was the 100th of his career.
Baez learned that it was his 100th homer after returning to the dugout and being mobbed by teammates.
"It's really exciting,'' Baez said. "I thought it was going to be a little bit later on in my career.''
Alonso's solo shot to center came on a soft 0-2 pitch from Hamels in the fourth that Hamels said resulted from a "mix-up'' with catcher Victor Caratini.
"Thankfully I saw two of them in the previous at-bat and saw it long enough and put a really good swing on it,'' Alonso said. "I'm proud of it, but I wish we won today. It was a tough loss.''
Baez said he talked to Alonso during the series and tipped his cap to the rookie.
"He's doing something amazing,'' Baez said. "He's almost got 30 homers and we've still got two more weeks until the All-Star break. I like the way he's playing the game and the way he's hitting the ball.''
ESPN Stats & Information and The Associated Press contributed to this report.