Julio Dely Valdes' side recorded a second win over el Tri in the 2013 Gold Cup to ensure a repeat of the 2005 showpiece against USA on Sunday
Roman Torres headed home the winner midway through the second half after Luis Montes had levelled following Blas Perez's opener, setting up a showdown with USA on Sunday in a repeat of the 2005 final.
Panama recorded a 2-1 win in the earlier rounds of the competition and they struck first against el Tri on Wednesday. In the 13th minute, midfielder Alberto Quintero played in Perez on the right side of the six-yard box and the forward blasted a shot past goalkeeper Jonathan Orozco for his 10th career goal of the tournament.
Mexico, however, did not take long to respond after surviving an early Panamanian onslaught. Following some fancy dribbling from Marco Fabian, the Chivas midfielder found Montes at the far post where he turned home a stylish header to level the scores.
But Mexico's reprieve was not to last - 15 minutes into the second half, Torres headed home Gabriel Torres' corner to stun the crowd expecting a fourth-consecutive final between el Tri and USA.
Mexico spurned a host of chances in the final quarter of the game: first Jorge Enriquez was denied by a fine stop from Jaime Pendo, before Montes fired just wide of the target.
Isaac Brizuela was then thwarted by the fingertips of Pendo before Javier Orozco squandered a great opportunity with just two minutes remaining, sending a diving header inches wide of the post.
Ultimately, Jose Manuel de la Torre's side could not find that elusive second equaliser and Panama progress to Sunday's showdown with Jurgen Klinsmann's USA.