Having trailed up until the 78th minute, Javier Hernandez’s 88th-minute goal put Mexico ahead before Hector Herrera sealed victory in the fourth minute of stoppage time.
Mexico dominated play for the majority of the match, but Trinidad and Tobago’s Shahdon Winchester opened the scoring in the 66th minute.
A late blitz with goals from Hirving Lozano, Hernandez and Herrera rescued the result for the home side.
Defeating CONCACAF’s bottom-placed team in the ‘Hexagonal’ round, Mexico remain top on 21 points after nine games, having already secured automatic qualification for Russia 2018.
Juan Carlos Osorio’s side are six points ahead of second-placed Costa Rica, whose 1-1 draw with Honduras on Saturday booked the Costa Ricans tickets to Russia.
Now on a six-game losing streak in qualifying, Trinidad and Tobago will likely finish the qualification cycle with the solitary win against Panama unless they can give the qualifying-bent United States a beating tomorrow night at the Ato Boldon Stadium in Central Trinidad.
Mexico started in predictably dominant fashion, but their best chances still only came from dead-ball situations.
Aside from early shots for Nathan Lewis and Leston Paul, Trinidad and Tobago were increasingly embedded in their own half moreso in the second half.
But Trinidad and Tobago took a shock lead via a quick counter-attack past the hour-mark with Winchester finding himself one-on-one with Jose Corona, curling his right-footed shot in off the post.
Already having brought on Lozano and Carlos Vela, Osorio sent numbers forward with a third substitution, as Oribe Peralta replaced Diego Reyes.
Mexico restored parity in the 78th minute, then Hernandez reacted quickest to make it 2-1 10 minutes later, before Herrera capped off the victory with a superb 94th-minute free-kick.