Riley's single five innings later was equally pivotal and helped the Braves keep rolling.
Riley hit a game-tying home run in the eighth inning then drove in the go-ahead run in the 13th with a two-out single off Reyes Moronta, lifting the Braves to a 5-4 victory over the San Francisco Giants on Thursday.
"That was a great at-bat," Braves manager Brian Snitker said. "It was a great approach by him. He's been very impressive so far."
Atlanta hit eight home runs in the four games with San Francisco, the most the Braves have hit in one series at the Giants' waterfront ballpark. They hit seven in a four-game series at Oracle Park in 2012.
Riley had three in this series. The 22-year-old became the fastest player in Braves history during the live-ball era to hit his first five home runs.
"That's cool," Riley said. "To be able to do that is an honor. The last hit was even more special to me because it put the team ahead and got the job done."
Riley already had one hit before his two-run homer off Tony Watson with two outs in the eighth.
The Braves had only one baserunner over the next four innings before Dansby Swanson singled against Moronta (1-4) leading off the 13th. After Freddie Freeman flew out, Swanson stole second base. One out later, Riley lashed a single to right field and Swanson scored easily.
Riley and Ozzie Albies both had three hits for Atlanta and Tyler Flowers homered. The Braves have won 10 of 13.
"Mentally he's in a good spot," Flowers said of Riley. "He's into his approach, he trusts himself. He doesn't panic on pitches in, out, up, down. He doesn't let that dictate what he's trying to do."
Luke Jackson (3-1), who blew his fourth save on Tuesday, retired six batters to win. The Braves closer called Riley "a human cheat code" and said the rookie has made a quick impression on his teammates.
"You expect it now," Jackson said.
San Francisco got the tying run on base with one out in the bottom of the 13th but Jackson struck out Mac Williamson before third baseman Josh Donaldson made a barehanded grab on Donovan Solano's short chopper, throwing to first for the final out.
Tyler Austin hit his first career pinch-hit home run, and Brandon Belt scored on a wild pitch for San Francisco.
"We let this one get away," Giants manager Bruce Bochy said. "We just couldn't get the bats going later on against their bullpen."
Atlanta's win overshadowed a strong outing by Giants starter Madison Bumgarner. The big lefty allowed two runs on six hits, walked two and left with a 4-2 lead. Bumgarner has a 2.12 ERA in nine games against the Braves since his last loss to them on Aug. 25, 2012.
Braves starter Kevin Gausman allowed three runs in six innings. Gausman has one win in his last nine starts.
Will Smith's swinging strikeout of Charlie Culberson leading off the ninth was the left-handed reliever's 11th consecutive out to come via strikeout, a San Francisco record.
MORE STRIKEOUT CHATTER
Williamson was hit by a pitch in his first at-bat then struck out the next five times he came to the plate. "Maybe I can go talk to Riley a little bit and get his opinion and get some pointers from him," the Giants left fielder said.
WATCH OUT FOR THE BIRDS
Riley got his first look at the seagulls that soar over Oracle Park late in games. "Stuff's coming out of the air and I'm like, 'I gotta get out of here,'" Riley said. "It was a lot of birds. There was a foul ball that almost hit one."
Giants: Brandon Crawford was held out of the lineup because of conjunctivitis (pink eye). The three-time Gold Glove shortstop is likely to sit out Friday as well, although Bochy said Crawford is available to pinch hit.
Braves: RHP Mike Foltynewicz (0-3, 6.91 ERA) will start Friday in St. Louis. Foltynewicz is winless in six outings and has allowed two or more home runs in five of them.
Giants: LHP Drew Pomeranz (1-4, 5.66) faces Arizona on Friday in his second start since coming off the injured list. Pomeranz is winless in nine career games (six starts) against the Diamondbacks.
More AP MLB: https://apnews.com/tag/MLB and https://twitter.com/AP_Sports
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.