No. Gaijin doesn't have such etymology. You must be confusing it with nanbanjin.Gaijin has it's origin in the word Barbarian.
Seven Stars: I can not at all understand the comment you directed at me.
I assume you are referring to Morrocan dutch - White dutch relations there,
I am not sure it's really the same, TBH. The social systems behind this tension is complex and drawn out.
However there is not a single shop or establishment in Holland that would refuse entry to anyone of any race.
I honestly think that you are doing your country a disservice by suggesting that might be the case.
I don't want to say too much about it because this thread is about Japan, but I am sure people get refused because of this in Holland. I am not talking about just Dutch Moroccans, but others as well. Of course there are no signs outside, or they would say it directly but they would make excuses that they don't have the right shoes that they need a card etc.