The Union isn't going to like the Confederacy taking any more territory, but there is very little they can do, unless they want to offend Britain and France.
The best the Confederacy can hope for is diplomatic recognition by Britain and France, neither will support the Confederacy in any offensive war.
If the Confederacy invades Mexico, they are almost certainly offending France. They won't be seen as liberators, either. The Union had already been supporting the Juaristas and taking that northern tier of Mexican states will require invading Juarista areas.
The CSA, which has a very strong military tradition, is able to make some initial gains and, possibly, strip the northernmost tier of states from Mexico, but they get drawn into a nasty insurgency.
In OTL, the CSA never succeeded in taking and holding Union territory. Their one attempt in the theatre, the New Mexico Campaign, resulted in some initial gains, followed by abject failure, even though half the Union forces were territorial militia.
The Confederate Army has a tradition of being failing to supply its troops with shoes, clothing, and food. Northern Mexico is not good territory for foraging. The Confederacy is also in bad financial sahpe and wars are expensive.
Mexico has a larger free population than the Confederacy. The northern tier of Mexican states is Baja California, Chihuahua, Coahuila, Nuevo León, Sonora, and Tamaulipas. Their population is over 600,000. While that's sparsely populated it's about 10 times the population of Colorado and New Mexico, who handily beat the Confederates in OTL.
Looking at the options from worst to best.
1) The Confederacy attacks while France is in control. This is stupid, but an independent Confederacy has at track record of picking fights with bigger powers and winning. They probably end up fighting France, the US, and Mexico and lose badly.
2) The Confederacy attacks while Juarez is in control. They probably end up fighting the US and Mexico and lose badly.
3) The Confederacy attacks while Mexico is still fighting itself. They end up fighting both sides of the Mexicans and probably manage a stalemate.
4) They cut a deal with Maximillian - they get the northern tier of Mexican states if they can defeat the Juaristas there. Maximillian secures the rest of Mexico while the Confederacy plunges into something resembling your scenario. They still probably can't take all of northern Mexico and holding it will be expensive. The Union was already "misplacing" thousands of muskets "near" (across) the border to the Juaristas in OTL.