Matt Miazga scored on a closer-range header from Graham Zusi's corner kick in the 88th minute, giving the United States first place in its
Panama's 3-0 win over Martinique meant the U.S. needed a three-goal win to move back over Los Canaleros into first.
The U.S. had a two-man advantage when Zusi took his free kick from about 30 yards because Luis Copete was ejected in the 86th minute for his second yellow card and Luis Galeano was receiving treatment for an injury.
Miazga, a Chelsea defender playing his first international match since May 2016, had an open header near a post and scored his first goal in three national team appearances.
The U.S. has won its group in 13 of 14 Gold Cups, finishing second to Panama in 2011. The Americans play their quarterfinal Wednesday in Philadelphia against a third-place team from another group, likely Honduras, El Salvador or Jamaica; a second-place finish would have meant a U.S.-Costa Rica matchup.