Even a 7-3 lead and a two-homer game by Nick Swisher weren’t enough for the Braves to stop the madness that their road woes have become.

The Cubs, after scoring four runs in the fifth and sixth innings to tie the score, won 9-7 on consecutive homers by Miguel Montero and Jorge Soler in the eighth inning Saturday before a festive crowd of 41,196 at Wrigley Field, handing the Braves their 21st loss in their past 23 road games including the past eight in a row.

Those last two homers came against ex-Cub Edwin Jackson (2-2), who was signed by the Braves this month after being released by the Cubs. He knows about having a bad outing on a windy day at Wrigley, where Jackson is 10-19 with a 5.76 ERA and 21 homers in 184 1/3 innings.

“You’ve just got to execute pitches and keep the ball on the ground,” said Jackson, who gave up homers on consecutive pitches to Montero and Soler. “Playing in this park as many times as I’ve played here, I know once you get the ball in the air, anything is possible.”

In his first two-homer game in nearly two years, Swisher had two-run homers from each side of the plate in the second and fifth innings, the latter capping a five-run inning that gave the Braves a 7-3 lead. But rookie starter Williams Perez and the Braves bullpen couldn’t hold it.

“You always want to win,” said Swisher, who homered from both sides of the plate for the 14th time in his career, tying Mark Teixeira for the all-time lead. “I guess individually it was a good day, but you want to stop that losing streak, man. You want to go out there and do everything you can to put a ‘W’ on the board for us.” And they’ll come.”

“We just need to keep grinding, keep battling, keep our heads up, and just keep working.”

After Swisher’s second homer capped a five-run fifth inning that gave the Braves a four-run lead, the Cubs stormed back with three in the bottom of the fifth on three hits and a walk against Perez. Two-out doubles by Kris Bryant and Miguel Montero drove in all three runs in the inning and chased Perez from the game with the lead down to 7-6.

“The importance of the shutdown inning,” Braves manager Fredi Gonzalez said. “We get two runs, they come out and score one. We get five — I don’t remember the last time we scored five in one game, let alone in one frame – and they got right back in it. That (the Cubs’ four runs in the fifth and sixth innings) was the two biggest innings of the whole game.”

The Cubs tied the score an inning later on No. 9 hitter Addison Russell’s homer off rookie reliever Matt Marksberry. The Braves challenged the home-run ruling because a fan reached over the fence and touched the ball before it landed in the wire home-run “basket” atop the fence, but the call was upheld.

“They felt like the ball hit high enough on his forearm that it was going to be in the basket anyway, and they didn’t have enough to overturn it,” Gonzalez said.

Braves center fielder Cameron Maybin, who was only a few feet from the ball and the fan, said “I get where they were coming from on the replay, but from where I was standing it looked like it had a legitimate chance to maybe hit off the front or go under that (basket).”

The wind was blowing out in left field, and the Cubs took full advantage.

“How many home runs did they hit, four?” Swisher said. “If those baskets aren’t there, we catch three of them. But I guess this ballpark plays a little differently on different days. Man, the atmosphere was electric. It’s just so great to be out there again.”

Perez got no decision and allowed eight hits and six runs in 4 2/3 innings, with two walks and four strikeouts. He’s 0-4 with a 7.98 ERA in five starts since returning from a five-week stint on the disabled list for a bruised foot after being hit by a batted ball. Perez was 4-0 with a 2.17 ERA in his past 10 games (eight starts) before going on the DL.

The Cubs scored in all but one of Perez’s five innings pitched. He gave up a triple to Dexter Fowler to start the first inning (he scored), allowed a run on three singles in the second inning, after Swisher’s two-run homer off Dan Haren in the top of the second had provided a 2-1 lead for Perez.

Perez gave up the go-ahead run in the third on a solo homer by Anthony Rizzo, his 25th of the season.

But the Braves’ much-maligned offense wasn’t done. Far from it. They back back with a five-run inning in the fifth for a 7-3 lead, their first five-run inning since June 9. The big blows were Nick Markakis’ leadoff double, Freddie Freeman’s RBI double off Travis Wood after the left-hander entered the game, A.J. Pierzynski’s two-run single, and Swisher’s homer off Wood.

It was the 21st multi-homer game for Swisher and his first since Sept. 15, 2013, when he hit two in another game in Chicago, against the White Sox on the South Side as a member of the Cleveland Indians.

Since he was traded to the Braves on Aug. 7, Swisher has only six hits in 29 at-bats, but half of those hits were homers. He also has two doubles.

In the nearly two years since his most recent multi-homer game, Swisher had played in 150 games and hit just .210 with 13 homers in 534 at-bats. He played most of those on ailing knees and had surgery on both knees Aug. 20, 2014, nearly one year to the day before his two-homer game Saturday.

Swisher and outfielder Michael Bourn came from the Indians in a trade for Chris Johnson, and Saturday was Swisher’s seventh start for the Braves and first in the outfield (he started six games at first base when Freeman was on the DL).