Christopher O’Flaherty, 21, took a fatal amount of MDMA during the party at Aimee Finan’s home in Wakefield, West Yorkshire.
A court heard Finan had arranged for O’Flaherty to buy drugs from her ex-boyfriend, Kane Pigford.
After Mr O’Flaherty’s death, police searched Pigford’s home and found drugs with a street value of over £60,000.
Leeds Crown Court heard the tragedy happened on June 3 last year when Mr O’Flaherty travelled from Ireland to West Yorkshire to visit friends.
Duncan Ritchie prosecuting, said he met a friend at Leeds bus station before going to Finan’s home where they drank and took ketamine.
Finan then made arrangements to meet Pigford at Westgate railway station in Wakefield where Mr O’Flaherty bought MDMA powder and pills from him.
They returned to Butterfield Way where other people joined them them as they continued to drink, take drugs and listen to music.
People at the party later described how Mr O’Flaherty began behaving strangely and complaining that he was too hot.
His friend also passed out at the party due to the drink and drugs he had taken.
Mr Ritchie said the circumstances leading up to the death were unclear.
Mr O’Flaherty’s friend regained consciousness and found his him laid in the back garden.
Everyone else apart from Finan had left the property.
Mr Ritchie said: “Finan went to check his pulse and looked worried.”
An ambulance was called and Mr O’Flaherty’s friend tried to revive him but he was pronounced dead at 11.45pm.
A post mortem revealed Mr O’Flaherty had levels of MDMA in his blood consistent with previous cases where people had died from taking the drug.
Police went to Pigford’s home on Calder View, Mirfield, after speaking to Finan.
MDMA tablets and powder was found at the property worth up to £65,000.
Amounts of LSD and other hallucinogenic drugs were also recovered.
Mr Ritchie said: “The death of Mr O’Flaherty was of course a tragedy.
“Aged 21 he had his life in front of him.
The devastation caused to his family will have been considerable.
“There is nothing to suggest that he took the drugs by anything other than his own free will.
“It is right to observe that neither defendant intended Mr O’Flaherty to come to any harm, but the dangers of the use of class A drugs are well known.”
Pigford, 25, pleaded guilty to supplying MDMA, possession of MDMA with intent to supply and possession of LSD.
He was jailed for four years, eight months.
Finan, now of Gibson Close, Wakefield, pleaded guilty to being concerned in the supply of MDMA.
Finan was given a 12 month sentence, suspended for 18 months, and ordered to do 140 hours of unpaid work.
Oliver Jarvis, representing both defendants, said Pigford had been storing the drugs at his home for other people.
Mr Jarvis said: “He is deeply affected by what has happened and the hand he had in it.
The barrister said Finan was of previous good character and had turned her life around since the incident.
He added: “She has completely changed her circle of friends and has a new partner.”
Sentencing the pair, judge Robin Mairs said: “The death of Christopher O’Flaherty is another salutary lesson to those who take class A drugs and to those who supply them.”