this expression comes from a London slang called Cockney rhyming slang. Very basically consist in replacing a word you do not want to pronounce to avoid be understood by others, with words that sound alike and rhyme, and may even have some relation of meaning.
In this case the word “Queer” was replaced by “Brighton Pier”, and after by “Ginger beer”, then shorting to “Ginger”. Similarly “Queer” resulted in “King Lear” which in turn resulted in “Jere” and “Gear” two slang for homosexual man.
Related Haricot, Iron, Jocker, Perry.