Heroin deaths plateaued after a spike in 2015, but cocaine-related deaths increased from 320 to 371.
The ONS said this was partly down to an increase in purity, as there had not been a significant rise in the number of people using the drug.
Its report said: "The National Crime Agency reports that there was a significant increase in crack and powder cocaine purity at all levels in 2016, including user-level, which may partly explain the increase in deaths relating to cocaine."
However, leading addiction researcher Professor Sir John Strang, of King's College London, said the high number of heroin deaths also raised concerns.
The number of deaths from heroin increased from 579 in 2012 to 1209 in 2016.
He told the Telegraph that the figures raised questions about the effectiveness of addiction treatment and said he was concerned patients were being let out of treatment centres too early because of funding cuts.
"We've got a persistent increase - that doesn't look like a problem that we've sorted," he said.
The Government attributed rising numbers to ageing heroin users who are more susceptible to overdose.
A spokesman said: "While drug misuse is lower than 10 years ago, we are absolutely committed to reducing it and the harm it causes.
"That's why last month the Government released a comprehensive new drugs strategy, setting out a balanced approach which brings together police, health, community and global partners to tackle the illicit drug trade, protect the most vulnerable and help those with drug dependency to recover and turn their lives around."