The Braves seized a 1-0 lead in the best-of-three National League wildcard series, with the winner to face the reigning World Series champion Los Angeles Dodgers in the best-of-five divisional round.
Trailing 3-2, Atlanta seized the lead for good when Michael Harris singled, took second base after Ozzie Albies was hit by a pitch, and Riley smashed a home run to right field off Phillies relief pitcher Jhoan Duran.
"He left something over the plate, and I got a good swing at it," Riley said.
"It means a lot. I've been grinding for these guys and the city all year.
"To finally come up big for them was huge. It's not over yet, but a nice start for sure."
Atlanta went 9-4 against the Phillies in the regular season and won the NL East division by six games over Philadelphia.
The Phillies opened the scoring in the first inning when Kyle Schwarber walked and raced home on Alec Bohm's double to centerfield.
The Braves equalized in the second when Albies walked, took third on a fielder's choice and scored on Mike Yastrzemski's single to centerfield.
Atlanta grabbed a 2-1 edge in the sixth when Harris singled to left and scored on an Albies triple to the centerfield wall.
The Phillies seized a 3-2 lead in the seventh after Bryan de la Cruz was hit by a pitch and took third on Bryson Stott's single.
J.T. Realmuto drove in both runners with a triple to right off Braves relief pitcher Didier Fuentes, setting the stage for Riley's game-winning blast and the Phillies falling in order in the ninth.
Atlanta pitcher Chris Sale, a 37-year-old American left-hander, made his longest career playoff start, striking out nine over 6 1/3 innings.
Padres dominate Cubs
Later in the National League wildcard round, hosts San Diego Padres demolished the Chicago Cubs 8-0 to take a 1-0 lead in their series.
The winner of that three-match series will next face the Milwaukee Brewers in the best-of-five divisional round.
Major League Baseball
The MLB Postseason is now underway. Follow the race to the World Series with ScoresStat!
