Gay was not originally a slur, AFAIK. It was adopted as a less clinical descriptor by gay people, especially gay men (again, AFAIK). There have been concerted efforts to make it into a slur and it is often used in a derogatory fashion, but it does not have a pre-history of being used as a slur.
Queer is the opposite. It was used as a slur and it is a rare example of successful reclamation of a word. A slogan in the 1980s on Gay Pride protests was “We’re here, we’re queer, we’re fabulous, get used to it”. At the time, queer was very much a slur so the chant had a bite that you wouldn’t hear in it today.