Have the French intervene in favor of the Confederacy after having already begun intervening in Mexico. At that point, the Juaristas and the Union are both fighting the French, and will want to coordinate their actions. I don't see Mexicans fighting the Confederates directly (too likely to backfire politically), but joint Union-Mexican operations against the French are certainly a possibility (especially on the naval end, with US Navy ships supporting Mexican land forces).
I don't see either Mexican side intervening after their own war is over; by this point Mexico has been in civil war since 1857, is heavily in debt, and has no appetite for foreign adventures.
Napoleon III was always more sympathetic to the Confederacy than the British were.