The annual showdown, typically pitting MLS' best against an elite European club, finished 1-1 at the end of 90 minutes in Los Angeles midweek.
But Dallas sensation Pepi settled the contest in the shoot-out after Orlando City star Nani had spurned an earlier opportunity to win it, miscuing his effort into the stands.
It was the 25th MLS All-Star Game and the first involving All-Stars from two different leagues, though it was the second time Liga MX had been involved after MLS All-Stars beat Chivas Guadalajara 3-1 in 2003.
Liga MX All-Stars opened the scoring via Jonathan Rodriguez, who controlled the ball off his chest before half-volleying into the bottom corner in the 20th minute.
Jesus Murillo restored parity for MLS All-Stars eight minutes into the second half when the Los Angeles FC centre-back's towering header beat Pumas goalkeeper Alfredo Talavera.
The 18-year-old Pepi then showed nerves of steel from the spot to lead the MLS team to their 10th victory in the All-Star game.