AP photo by Ben Margot / The Atlanta Braves' Eddie Rosario celebrates after hitting a double in the eighth inning of Friday night's home game against the New York Mets.

ATLANTA — Brandon Nimmo hit two solo home runs and Tylor Megill allowed one hit in five scoreless innings as the New York Mets beat the Atlanta Braves 4-3 on Friday night, snapping the National League East champions' six-game winning streak.

One night after clinching their fourth straight division title by completing a three-game series sweep to eliminate the Philadelphia Phillies from playoff contention, the Braves played just three regulars: second baseman Ozzie Albies, left fielder Eddie Rosario and Austin Riley, who moved from third to first base with veteran Freddie Freeman resting.

Freeman had treatment on his right elbow, which was hit by a 100 mph pitch the night before.

The Mets scored first in the fourth inning when Francisco Lindor led off with a walk and Pete Alonso, who went 3-for-4, doubled him home. Alonso took third on shortstop Orlando Arcia's errant throw to the plate. He was initially called out, but a video review showed he beat Ehire Adrianza's tag.

New York scored again in the inning on James McCann's RBI single, but Braves starter Huascar Ynoa (4-6) struck out Megill to strand the bases loaded.

Megill (4-6) didn't allow a hit until Albies singled to center with one out in the bottom of the fourth. Albies stole second but was stranded on Riley's strikeout and Rosario's groundout.

Megill hopes to carry his final start of the season into 2022, when he'll be a candidate to stay in the rotation.

"Very important," he said. "Being able to go out there and throw well and that high that you threw well and you had success going into the offseason knowing that you finished strong. Keep that momentum going through the offseason and get ready for the next."

Nimmo's seventh homer of the season put New York up 3-0 in the fifth. Nimmo's eighth, off Spencer Strider in the seventh, made it 4-1. Both landed in the right-field seats.

"Tonight we saw him getting ready actually early and landing in a strong position and being able to extend the bat," Mets manager Luis Rojas said. "He's a strong human being, and if he gets himself in a position where he can get the barrel out there, things like this can happen. There is power in it."

Atlanta's Rosario hit his 14th homer of the year in the seventh off Heath Hembree, cutting the Mets' lead to 4-2. Adrianza homered off Trevor May in the eighth, and the Braves had two runners in scoring position when the eighth ended on Orlando Arcia's lineout.

Edwin Díaz earned his 32nd save in 38 chances this season by working the ninth.

The Mets, assured of their fourth losing record in five years, are 30-49 on the road.

Megill, who walked one batter and struck out six, had lost his previous two starts and had 12.86 ERA during that stretch. He had given up 12 homers in his previous six starts.

Jeurys Familia gave up Atlanta's second hit, a single by Adrianza in the sixth. Adrianza scored on Albies' double, trimming the lead to 3-1.

Ynoa, who hasn't won since May 9, allowed three runs and six hits with two walks and six strikeouts in five innings. He is 0-2 with a 6.52 ERA in six starts this month.

"He's not a finished product yet," Braves manager Brian Snitker said. "He's still learning, but overall I thought his stuff was good tonight."

Mets outfielder Kevin Pillar faced Jacob Webb for the first time since the Atlanta reliever hit him in the face with a pitch on May 17. Pillar struck out with runners on first and third in the sixth.

New York second baseman Javier Báez's career-best 23-game on-base streak ended when he went 0-for-4. He hit .386 with 18 runs, four doubles, four homers, 13 RBIs, 10 walks and five stolen bases during the streak.