Alonso hit his 27th home run in the fourth, breaking the Mets record for most by a rookie in an entire season set by Darryl Strawberry in 1983.
With the Mets clinging to a one-run lead, Baez launched his 19th homer of the season with Kyle Schwarber and Anthony Rizzo on base and one out. Baez sent an 0-2 pitch from Seth Lugo (3-1) halfway up the right field bleachers.
"He just kind of hanged it out a bit and I got the barrel on it," Baez said. "I think when I get to two strikes, I try to see the ball better and cut down my swing, which is pretty hard for me because I gotta swing hard."
Baez learned that it was his 100th homer after returning to the dugout and being mobbed my teammates.
"It's really exciting," Baez said. "I thought it was going to be a little bit later on in my career."
Mets starter Jacob deGrom allowed two runs and eight hits in six innings. The NL Cy Young Award winner struck out nine and walked none.
DeGrom also drove in a run with a single.
Alonso's solo shot to center came on a soft 0-2 pitch from Hamels in the fourth that Hamels said resulted from a "mixup" with catcher Victor Caratini. The 24-year-old had homered on Saturday to set a new mark for NL rookies before the All-Star break.
"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."
Alonso connected in his 77th game while Strawberry hit 26 in 133 games in 1983. The Mets' record for homers in a season is 41, shared by Carlos Beltran and Todd Hundley.
Baez said he talked to Alonso during the series and tipped his cap to the rookie.
"He 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."
Strawberry also took note.
"Congrats to Pete for breaking my record which has stood for a long time," Strawberry said in a statement. "What he's done in a short period of time is most impressive. No goal seems out of reach."
Alonso is nearing Mark McGwire's major league record for homers by a rookie before the All-Star break, 33 set in 1987.
Tomas Nido also homered for the Mets.
Hamels helped his cause with an RBI single and Rizzo drove in Chicago's other run as the Cubs salvaged a split in the four-game series.
Hamels yielded three runs on seven hits through seven innings.
NEW YORK STATE OF MIND
Mets manager Mickey Callaway cursed at Newsday reporter Tim Healey, and pitcher Jason Vargas had to be restrained from charging him during a confrontation in the team's clubhouse after the game.
Reporters asked repeatedly after the game about Callaway's decision to stick with Lugo instead of going to closer Edwin Diaz. After the press conference, Callaway walked past Healey in the clubhouse. Healey told Callaway he would "see you tomorrow," and Callaway responded by calling Healey an obscenity. Callaway walked away and then returned, cursing at Healey again and telling him to leave the clubhouse.
Vargas then stared down Healey and eventually tried to charge him. Players stepped in to restrain the veteran left-hander.
No punches were thrown, and Healey left the clubhouse moments later.
RHP Craig Kimbrel is expected to pitch at least one more time for Triple-A Iowa, probably Tuesday, before the Cubs consider recalling the closer, manager Joe Maddon said.
After tossing a scoreless inning Friday, Kimbrel threw again Saturday as an opener for Iowa in a rain-shortened contest. The right-hander allowed a run and got two outs as he pitched in back-to-back games for the first time since finalizing a three-year, $43 million deal with the Cubs on June 7.
Mets: Callaway said before the game he had no timeline on next steps for RHP Noah Syndergaard (right hamstring), who threw a bullpen on Saturday. "We'll talk to the player and see exactly what we want to do next," Callaway said. Syndergaard is eligible to come of the 10-day IL on Wednesday.
Cubs: Chicago activated RHP Tony Barnette (right shoulder inflammation) off the 60-day injured list and optioned RHP Rowan Wick to Triple-A Iowa. Barnette, 35, started the season on the IL. He went 2-0 with a 2.39 ERA in 22 relief appearances for Texas in 2018 before a shoulder strain ended his season in early July.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Nationals owner Mark Lerner says team can't keep both Stephen Strasburg and Anthony Rendon
Stephen Strasburg and Anthony Rendon were key components in the Nationals winning the franchise's first World Series title this year, but Mark Lerner, the team's principal owner, is already preparing to say goodbye to at least one of them in free agency.
Who should be voted to the Baseball Hall of Fame this weekend?
Ten names from the modern era are under consideration for the Hall this weekend. Here's what our ballot would look like.
Mookie Betts to the Reds (or White Sox) and more winter meetings trades we want to see
Hoping for a busy week of moves in San Diego? So are we. Here are some deals that would get everyone talking.
Tommy Pham headed to Padres; Rays to get Hunter Renfroe
The Padres are set to acquire OF Tommy Pham and two-way prospect Jake Cronenworth from the Rays in exchange for Hunter Renfroe and touted 2B prospect Xavier Edwards, sources told ESPN.
Ex-Yankees pitching coach Larry Rothschild hired for same position with Padres
Former New York Yankees pitching coach Larry Rothschild has been hired in the same position by the San Diego Padres.
Athletes join in on the 'Baby Yoda' meme frenzy
To iconic meme status Baby Yoda ascended has. The collective Internet has been going wild over the lovable Disney+ character and the sports world is no exception.