Maybe he got his information through the "cowboy telegraph" in otherwords living up in Montana he probable worked with itinerant herders form Texas/Mexico and as people do they tell each stories around the campfire and I am guessing they don't talk about their favorite bean recipe.
Agreed. Stuff like this gets around. Plus, remember that this general topic (queerness, to use the term) was obviously on Ennis, mind all those years. Perhaps not in any sort of self-identifying way, but at least in a worried way of wondering what he was doing, worrying others would find out, etc. In that sort of mental state you latch on tightly to anything you hear related to it.
Say (just for example) Ennis was a heroin user. And one time over the years somebody around a campfire talks about his sister whose boyfriend got busted for selling heroin in Phoenix, saying it is big there and they lived a high life while it lasted. To anyone else that story would quickly be forgotten, but as a heroin user Ennis would probably always remember that Phoenix is a good place to go if he ever finds himself leaving Wyoming.
Obviously that's a silly example, but I use it to point out that someone like Ennis probably didn't need to hear rumors of Mexico more than once for them to stick in his mind and dwell for a long time. I think it was very plausible that Ennis would know what Mexico could mean to Jack.