Trevor Story, C.J. Cron and Garrett Hampson also homered for Colorado, which has won three straight.
The Rockies trailed by two runs twice before Tapia ended it with a shot over the scoreboard in right field off closer Hector Neris (1-2). It was his third homer of the season.
''The pitch before that he threw the same pitch, so I was kind of sitting on that pitch,'' Tapia said through a translator. ''I knew I hit it on the barrel and I knew it had a chance. I knew I hit it well.''
It was the first game-ending homer of Tapia's career. He flung his helmet to the side as he ran down the third base line toward home.
''The dreadlocks were flowing and the guys were waiting for him at home plate,'' Rockies manager Bud Black said. ''Those are always fun.''
Mychal Givens (1-1) pitched the top of the ninth to earn the win.
Philadelphia led 2-0 but solo homers by Story - his first of the season - and Cron in the fourth tied it.
''Trev exhaled, I'm sure, after that one,'' Black said of Story's homer. ''There's more to come. Usually with Trev when he hits one the next one's coming pretty soon.''
The Phillies made it 4-2 in the seventh on Andrew McCutchen's sacrifice fly and a homer by Rhys Hoskins, his fourth. The Rockies got within a run in the bottom half and Hampson tied it with a solo homer in the eighth.
Philadelphia was 0 for 10 with runners in scoring position. Three of the Phillies' runs were scored on outs.
''We haven't hit particularly well all year and it's a good reason we're 9-10,'' manager Joe Girardi said. ''We have to have better at-bats with runners in scoring position.''
Vince Velasquez started for Philadelphia with left-hander Matt Moore on the COVID-19 list. It was Velasquez's first start of the season and fourth appearance, and he left after allowing two runs on five hits in four innings.
Colorado starter German Marquez gave up two runs on six hits and struck out eight in six innings.
Phillies: INF Brad Miller was scratched from the lineup with a stiff neck. ... Girardi said he expects Moore as well as LHP Jose Alvarado and INF Ronald Torreyes - also on the COVID-19 list - to join the team in St. Louis early next week. ... Bullpen coach Dave Lundquist and hitting coach Joe Dillon rejoined the team in Colorado. Both had been on the COVID-19 list. Third base coach Dusty Wathan, staff assistant Bobby Meacham and first base coach Paco Figueroa are still on the COVID-19 list.
Rockies: LHP Kyle Freeland (strained left shoulder) threw on the side and is expected to have his first bullpen session Saturday, Black said. ... INF Brendan Rodgers (right hamstring strain) is doing some activities but has not started running on the grass.
Shortstop Didi Gregorius was back in the Phillies' lineup after missing three games with inflammation in his right elbow. Gregorius said his kidney disorder, discovered in 2011, delayed his return.
''When I have inflammation it doesn't go away. That's one of the things I've been dealing with,'' he said before the game. ''If I get hit by a pitch it stays swollen for like a week or two, so that's why I try not to get hit.''
The Rockies revealed the logo created for the 2021 All-Star Game to be played at Coors Field on July 13. Major League Baseball moved the game from Atlanta to Denver after the Georgia Legislature passed an election bill in March that drew criticism.
Philadelphia RHP Aaron Nola (1-1, 2.19 ERA) will face Colorado RHP Antonio Senzatela (1-3, 5.40) on Saturday in the second of the three-game weekend series.
More AP MLB: https://apnews.com/MLB and https://twitter.com/AP-Sports
Copyright 2021 STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.