The 19-year-old man was among 16,000 people who attended A State of Trance at the Sydney Showground at Olympic Park on Saturday, when police said he collapsed.
Officers said a group of men had been playing a game in which they competed over the number of drugs they could take, but it is unclear if the 19-year-old who died was part of that group.
Dance festival overdose death prompts drug policy debate (PM)
The man was assisted by medical staff before he was taken to hospital in a critical condition where he later died.
A post-mortem examination and toxicology test will be carried out and a brief prepared for the coroner.
A 20-year-old Arncliffe man was also taken to hospital and remains in a critical but stable condition on life support, police said.
Four other men were transported to hospital after taking what was believed to be illicit drugs, while 23 other patrons were treated by medical staff at the event, police added.
Three people were arrested for drug supply at the dance party which was headlined by Dutch DJ Armin van Buuren.
Police said a 20-year-old Auburn man was charged with a number of offences including the supply of more than an indictable quantity of drugs and dealing with proceeds of crime after being found in possession of nearly 100 tablets believed to be MDMA and cash.
A 20-year-old Greenacre man was also charged with supply of more than an indictable quantity of drugs, while a 21-year-old Victorian man was arrested after police searched him and allegedly found 15 tablets believed to be MDMA.
Numerous other patrons were issued with a criminal infringement notice for drug possession and other offences, and 40 charges were laid by police.
Officers said drug dogs searched about 180 people at the event.