South African Semenya, 32, who is classed as having "differences in sexual development (DSD)", has refused to take testosterone-lowering medication as mandated by the sport's international federation, World Athletics.
Semenya lost an appeal against the Lausanne-based Court of Arbitration for Sport and Switzerland's supreme court subsequently confirmed the decision of sport's top court.
As part of her long-running legal battle, she took her case against Switzerland to the France-based ECHR.
In its ruling on Tuesday, the court "found in particular that the applicant had not been afforded sufficient institutional and procedural safeguards in Switzerland to allow her to have her complaints examined effectively".
Semenya's victory is largely symbolic as it does not call into question the ruling by World Athletics and does not pave the way for her to return to competition in the 800m.
Semenya won Olympic gold at the 2012 London Games and at Rio in 2016.
World Athletics said in a statement noting the decision that it would liaise with the Swiss government on the next steps and, "given the strong dissenting views in the decision, we will be encouraging them to seek referral of the case to the ECHR Grand Chamber for a final and definitive decision".
The federation added: "We remain of the view that the DSD regulations are a necessary, reasonable and proportionate means of protecting fair competition in the female category as the Court of Arbitration for Sport and Swiss Federal Tribunal both found, after a detailed and expert assessment of the evidence."
World Athletics introduced the DSD regulations to create a level playing field in events ranging from 400m to one mile. Semenya was forced to move up to the 5,000m, a distance in which she failed to reach the final in last year's world championships in Eugene.
In March this year, the federation amended the rules. DSD athletes now have to reduce their amount of blood testosterone to below 2.5 nanomoles per litre, down from the previous level of five, and remain below this threshold for two years.
World Athletics also removed the principle of restricted events for DSD athletes, meaning regulations now cover all distances rather than the previously monitored ones.