The 52-year-old tourist was robbed and raped at knife point in January 2014.
Nine people, including three minors, were arrested for the crime. One of the accused died, while the minors are being tried in a juvenile court.
Scrutiny of sexual violence in India has grown since the 2012 gang rape and murder of a student on a Delhi bus.
The five men have the right to appeal against the sentence in a higher court.
The tourist had lost her way to her hotel in Delhi's Paharganj area when she approached the men to ask for directions.
She gave police a detailed statement about what happened to her in the presence of the Danish ambassador before leaving the country soon after the assault.
The 2012 gang rape led to protests and new anti-rape laws in India.
However, brutal sexual attacks against women and children continue to be reported across the country.
A court in the Indian capital Delhi has sentenced five men to life imprisonment for the 2014 gang rape of a Danish woman in the city.