Japanese, if not identifying someone by their nationality, will generally refer people from other Asian countries except the Indian subcontinent as Asian. Interestingly Japanese will not often refer to themselves as Asian.
Most every body else is Gaijin with the exception of people of African descent who are often referred to as Kokujin (which literally translates to black person). Sometimes Caucasians are referred to Hakujin (which literally translates to white person).
Very little effort is made to discover someone's nationality and then use that as a descriptor. Here the policy of "Us" and Them" is alive and well.
What I have taken years to understand, and it still confuses me at times, having been raised in the US where their is a fair bit of sensitivity to this is the Japanese are simply using the words, but attach no sense of bigotry to them They are simply labels to be taken with a grain of salt.