The Braves improved to 11-3 since manager Brian Snitker put Swanson in the No. 2 slot ahead of Freeman on May 10.
"I think we help each other a lot," Swanson said. "I would like to think that I help him, especially if I'm on base, that he would be able to get pitched differently. But having him hit behind me is fun."
Swanson drove Miles Mikolas' first pitch of the sixth inning over the wall in left, giving Atlanta a 2-1 lead. Freeman then hit his 13th homer, giving Atlanta its third set of back-to-back homers this season.
"Completely different than last year," Freeman said about Swanson, the No. 1 overall pick in the 2015 amateur draft. "He's staying on pitches a lot longer, seeing balls a lot longer, and putting the barrel on the ball. He's been huge for us."
Swanson and Freeman also hit consecutive homers in the second inning Wednesday night in San Francisco.
Foltynewicz (1-3) allowed an unearned run in six innings in his first win since Sept. 28. The right-hander struck out seven and walked none.
"I think that's the biggest thing right now is confidence, just throwing the ball with conviction," Foltynewicz said. "We kept them off balance just enough the whole night."
Swanson helped put it away with a two-run drive off Giovanny Gallegos in the eighth for his 10th homer. It was his second career multihomer game.
"It's really fun to watch," Snitker said. "He's a confident kid. He's been in the league another year. I sound like a broken record, but it's the truth. He's playing with a lot of confidence and knows he belongs here."
Mikolas (4-5) matched his career high with nine strikeouts in seven innings. He was charged with three runs and seven hits while exceeding his number of losses from all of last season.
"I had a couple games early in the season last year where I gave up four or five runs and we scored eight or nine and a couple tough ones like this," Mikolas said. "That is baseball. Things tend to even out, and I think that's why myself and a lot of the guys around the clubhouse aren't too worried."
Kolten Wong reached second on rookie Austin Riley's error. Harrison Bader then tripled to center off Acuna's glove, but he was tagged out after being caught in a rundown between third and home when Foltynewicz cut off the throw to the plate.
"That was a huge confidence point right there, just to get him out," Foltynewicz said. "I could have had a guy on third, no outs, and it could have been a big battle. But we got that guy out there and now we just, with no one on, now we go."
The Cardinals announced struggling right-hander Michael Wacha is going to work out of the bullpen. Wacha is 2-2 with a 6.39 ERA in his last five starts.
Wacha last pitched in relief on Sept. 26, 2016, versus Cincinnati.
Braves: OF Matt Joyce was placed on the bereavement list following the death of his uncle. Snitker says Joyce will miss all three games against St. Louis and return for Tuesday's home game against Washington. RHP Kyle Wright was recalled from Triple-A Gwinnett.
Cardinals: RHP Ryan Helsley was optioned to Triple-A Memphis. OF Lane Thomas remains with the club after being recalled to serve as the team's 26th man for Game 2 of Wednesday's split-doubleheader versus Kansas City.
Braves RHP Mike Soroka (5-1, 1.01 ERA) faces Cardinals RHP Dakota Hudson (3-3, 4.30 ERA) on Saturday night. Soroka allowed three hits in seven scoreless innings in his only previous outing versus St. Louis on May 15.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Alipour: Manfred is trolling us by bringing up Las Vegas
Sam Alipour responds to reports that MLB commissioner Rob Manfred mentioned Las Vegas as a possible new home for the Oakland A's.
Source: Twins nearing deal to keep Derek Falvey in front office
Derek Falvey joined the Twins in October 2016 from Cleveland, where he was the assistant general manager.
Sources: Twins expected to pick up $12M option for Nelson Cruz
Nelson Cruz, who became just the third player in team history to hit 40 home runs, is expected to remain with the Twins for 2020 when they exercise their $12 million option, sources told ESPN.
Atlanta Braves' Adam Duvall to start Game 5 in left after offensive heroics
Atlanta Braves outfielder Adam Duvall will start Wednesday in Game 5 of the NLDS against the St. Louis Cardinals after coming off the bench in each of the first four games of the series.
'They challenge each other': Walker Buehler and Clayton Kershaw look to pitch Dodgers into NLCS
The pair of L.A. aces are very different pitchers -- and people -- but they've bonded as teammates. Wednesday, they're expected to combine forces against the Nats in a winner-take-all Game 5.
Could the Black Sox scandal happen today?
One hundred years ago today, the White Sox lost the 1919 World Series, ushering in baseball's darkest hour. Is MLB gambling with its future by embracing betting now?