A man has pleaded guilty to killing his mate who died from a heroin overdose after a drug-fuelled bucks' night in Sydney.

Daniel Gray, originally from New Zealand, pleaded guilty in the District Court in Sydney on Monday to the unlawful killing of Greg Wood on January 4, 2009.

Mr Wood died in a Sydney hotel after taking heroin with Gray for the first time during another friend's bucks' night.

Gray, who injected and then tried to revive Wood, was charged after a Sydney inquest.

Mr Wood's widow reportedly told the inquest she did not want any charges to be laid against Gray.

He will face a sentence hearing on April 26.