Gomez (2-1) got into trouble right away, walking Kolten Wong to lead off the ninth.
"I'm disappointed in the first hitter," Gomez said. "The first hitter I had the walk, he tied the game. I have to make a good pitch in that situation."
Matt Adams drove a ball off the top of the center-field wall to put runners at second and third with one out. The Cardinals asked for a crew chief review to determine if it was a home run, but after 34 second review the call stood.
Gomez then intentionally walked Aledmys Diaz to load the bases, but Stephen Piscotty's infield single off of Freddy Galvis' glove scored Wong to tie it. Carlos Martinez, pinch-running for Adams, strayed off third base on the play and was out in a rundown.
Diaz advanced to third during the rundown. Phillies manager Pete Mackanin questioned crew chief Mark Carlson whether Cardinals third base coach Chris Maloney interfered, allowing Diaz to take third.
"I asked and he said the third base umpire signaled it didn't interfere with the play," Mackanin said.
Diaz then easily scored on Matt Holliday's single to left to end the game. After allowing the two runs, Gomez's ERA jumped to 2.70.
"We walked five guys and three of them scored so the walks kind of hurt us," Mackanin said. "But like I said, Gomez walked the leadoff guy, which I wasn't real happy about, but then he had a situation to get a ground ball. That's what we wanted him to do, and he gave us a ground ball that found a hole."
Gomez's struggles undid what had been a strong performance by the Phillies bullpen as four relievers had combined for four shutout innings to preserve a one-run lead.
Colton Murray got the Phillies out of a two-on, no-out jam in the fifth. Starter Adam Morgan had already allowed three runs in the inning, but Murray got Holliday to ground into a double play and he got Randal Grichuk to ground to short.
Andrew Bailey pitched around a two-out hit in the seventh and Hector Neris was aided by a great catch at the left field wall by Tyler Goeddel to rob Jedd Gyorko of extra bases.
"For me, our team had battled all game and to have a blown save you feel bad because the whole team played hard," Gomez said. "You think about the mistakes you made today and try not to do it the next game."