The Brazilian football federation says the injury is not serious but the Inter Milan goalkeeper won't recover in time for the friendly match in Torreon.
The 32-year-old Julio Cesar was hurt in Brazil's 1-0 win over Costa Rica on Friday and had to be substituted in the second half.
Botafogo goalkeeper Jefferson is expected to replace Julio Cesar against Mexico.
Julio Cesar has been given permission by Brazil coach Mano Menezes to return to Milan.
He is likely to miss Saturday's club game against Catania but could return for Inter's Champions League match at Lille three days later.