Warders at Saughton were forced to restrain 30-year-old Allan Marshall who it is claimed became violent.
Jail bosses suspect he may have been under the influence of a legal high and toxicology reports are being carried out.
An inquiry has been launched by Police Scotland, the Scottish Prison Service (SPS) and the Crown Office into Marshall’s death, which is being treated as unexplained.
After the incident, it is understood Marshall was taken to the Royal Infirmary with breathing difficulties but died last Saturday.
It is understood that all five officers received injuries, including bites, while trying to restrain him.
Marshall had no record of violence and was said to be a model prisoner, with sources describing his behaviour as out of character.
A spokesman for the SPS said the death in custody had been reported to the procurator fiscal for a fatal accident inquiry.
A prison source said he appeared to have acted in a very uncharacteristic and violent way, putting up a fierce fight for no apparent reason.
“We do not know whether or not he took something, but there is a suspicion that he did.”
Marshall ran his own business in Govan, Glasgow, and was awaiting trial after an incident outside a Hamilton nightclub.
He was on bail for an unrelated incident involving a former partner at the time of his arrest and had several conviction for minor offences.
His solicitor Matthew Berlow said he was “shocked” to learn of the death of his client, adding: “Allan was essentially a good person. He had ongoing matters which I was dealing with but they were not of a serious nature.”