Kyle Beckerman had tied the score four minutes into second half and the USA pressed for the winner against the Canaleros, whom it has been in the knockout stage of the last three Gold Cups.
The USA had a 16-3 edge in shots on goal but couldn't get the second goal in regulation.
"It was a challenge to the team to be in that spot at halftime and I still felt good that the response was strong," said U.S. coach Bob Bradley. "When we didn't finish the game in regulation, you still got a sense the mentality was "we're going to take care of this thing. The players deserve a lot of credit for that."
Panama's Blas Perez had scored in first-half stoppage time, shortly after U.S. captain Jimmy Conrad was injured when he butted heads with a Panamanian defender. Clearly shaken, Conrad was taken off the field and replaced by Clarence Goodson.
Perez and Panama captain Felipe Baloy were ejected at the end of the game for arguing with referee Benito Archundia.
July 18 in Philadelphia
USA 2 Panama 1. Goals: Beckerman 49, Cooper pen. 105; Perez 46+.
USA -- Perkins, Heaps, Marshall, Conrad (Goodson, 46+), Pearce, Holden, Pause, Beckerman, Rogers (Evans, 110), Ching, Arnaud (Cooper, 77)
Panama -- Penedo. R.Torres, Baloy, Gun, Moreno, Gomez, M.Torres, Escobar (Phillips, 78), Barahona (Herrera, 96), Garces, Perez
Yellow Cards: USA -- Conrad 11; Panama -- Perez 25, Baloy 63, R.Torres 104, Perez 120.
Red Cards: Panama -- Baloy 120, Perez 120.
Referee: Benito Archundia (Mexico).