Gabacho is the harsher term and is almost exclusively used for the purpose you described in Mexico and the Western US. In fact, it's usage stems from Mexican slang as opposed to centralized language. In Central America, we're Gringos. Nicaraguans don't know what a gabacho is. Gringo IS the universal term for foreigner.
Gringos don't call gabachos gringos, users of Mexican slang (i.e. gang members and Mexican people who are lower on the socioeconomic ladder) call gringos gabachos.
Trust me, in all the time I spent in Mexico, I was only called a gabacho ONCE.