The National Aids Trust (NAT) has described the decision as "shameful" and says lives will suffer if the drug known as Prep is not made available.
The NHS says it is up to local authorities to provide the treatment.
Both sides have agree to ask the court for an unusually fast timetable to resolve the issue within 6-8 weeks.
Prep (pre-exposure prophylaxis) is a daily pill that has the ability to reduce the risk of an HIV infection by more than 90%.
It is currently used in America, Canada, Australia and France to help protect the most at risk gay men.
In its legal challenge, the NAT argues it is possible for the NHS to fund preventative treatment through its specialised commissioning. It also argues there is no distinction between Prep and another HIV prevention drug treatment known as PEP (post-exposure prophylaxis) which is funded by the NHS.
A statement on the NHS England website said: "As set out in the Local Authorities (Public Health Functions and Entry to Premises by Local Healthwatch Representatives) Regulations 2013, local authorities are the responsible commissioner for HIV prevention services."
A charity has launched a judicial review challenging the NHS's decision not to fund a so-called game-changer drug treatment that can prevent HIV.