I always thought it was spelled "gaijin". But, anyway, IIRC, it's a slightly derogatory term for a foreigner. Like a "haole" in Hawaiian, or "gringo/gringa".
In Yiddish, we have a somewhat comparable, yet distinct, set of terms.
Anyone who is not Jewish might be referred to as a "Goy". In that context, it simply means, "non-Jew", and is not derogatory. The plural thereof is "Goyim", also not derogatory.
However, if someone who is Jewish engages behavior that is perceived by the person making the judgement to be unbecoming to a Jew, to somehow be outside some standard, a Jew might remark that another Jew's behavior is "Goyishe", meaning, not sufficiently Jewish in the eyes of the speaker. Example: I recently lamented to another East Coast Jew that Eugene is devoid of authentic Jewish restaurants, emphasizing that the local "Jewish deli" serves bacon and meat-with-cheese breakfast sandwiches, both of which are not Kosher (i.e., do not fit Jewish dietary guidelines) and are thus "Goyishe". Though truth be told, my bias is more from being vegetarian than from having many relatives who keep Kosher!