I've been living in Japan for 7 years. Some of my friends even longer (12+ years), fluent in Japanese, including keigo (formal/honorific speaking) and local dialects. Even if you develop some life-long friendships, you're still a gaijin. You'll always be a gaijin. ESPECIALLY when interacting with anyone outside your immediate social circle.
One friend has a half-Japanese wife and has been here about 15 years. He's finally gotten so fed up with what he feels is disrespect and alienation from a VERY large population of objectively dumber/less ambitious/less successful human beings that he's actually considering moving back to America.
One incident that set him off on a day-long tirade (he was under a LOT of stress at the time) was when he pulled up to a drive-thru to order, he made some jokes with the staff, and I'm sure the staff thought they were talking to a Japanese guy. Then he pulls up to the window....and the Japanese staff are staring at a big black Jamaican man......and they just stared, speechless...then began chatting amongst themselves about how surprised they were. They had totally forgotten their formal customs and courtesies that any service staff would say if they were interacting with a Japanese customer. He blew up, cursed them out in Japanese, demanded to see their manager, scolded the manager in Japanese, etc....