Andres Guardado and Giovani Dos Santos also scored for Mexico, which has won two consecutive Gold Cup titles and six overall. The victory qualifies Mexico for the 2013 FIFA Confederations Cup, a preview of the 2014 World Cup.
Michael Bradley and Landon Donovan scored to help the United States build a 2-0 lead. Donovan became the Gold Cup's all-time leading scorer with 13 goals.
Barrera put Mexico ahead to stay in the 50th minute, slipping a 10-yard shot underneath the right hand of diving goalkeeper Tim Howard and inside the left post.