All five were found inside a one-bedroom property in Barnet on March 1 at around 2pm, which was searched as part of an operation by officers from the Barnet Gangs Unit.
Heroin, crack cocaine and cannabis were all found within the property and an investigation established the drugs were being supplied in Kent and Surrey.
PC Owen Bateman said: "These men were caught with a large quantity of class A drugs as the result of a proactive operation by officers in the Gangs Unit.
"The supply of drugs across London and the Home Counties fuels violence and exploitation, particularly involving young people.
"I hope the lengthy jail sentences handed to these five men will deter those tempted to become involved in drug dealing."
During the search of the Barnet address, an officer outside the property filmed one 25-year-old defendant, Salman Ahmed, of North Wembley, throwing a bag over the side of the balcony.
A large amount of packaged crack cocaine and heroin was then found on the ground.
Ahmad Azimi, 22, from Maidstone, was also seen throwing wraps of the class A drugs off the balcony as police forced entry to the building.
Inside, police found several loose wraps of drugs in the kitchen and in the middle of the living room.
They also discovered mobile phones, electronic scales, a razor blade and zip lock bag of cannabis.
A large, vacuum-sealed bag of cannabis was then found in a cupboard.
All five men were arrested at the address and taken into police custody. They were later all convicted of possession with intent to supply crack cocaine, heroin and cannabis.
Three of the men, including Ahmed and Azimi, were sentenced at Harrow Crown Court on Friday (October 26) following a five-week trial, while the other two received slightly shorter sentences after pleading guilty.
Shaban Hotak, a 23-year-old from Roman Road, received a sentence of five years and six months in prison at the end of his trial, as did both Azimi and Ahmed.
The two 21-year-old men who pleaded guilty at Harrow Crown Court on August 29 - Hussein Mohamed Ismail, of Brenthurst Road, and Samim Islami, from Chessington - received four years and five years in prison respectively.