Italy went ahead through a stunning free kick from Andrea Pirlo, celebrating his 100th cap for his country.
Mexico levelled through Javier Hernandez’ penalty after Giovani dos Santos was hauled down by Andrea Barzagli, but Mario Balotelli bullied his way through on goal to smash home a late winner.