Yussuf Poulsen scored an 84th-minute winner, coolly slotting the ball home to the delight of the home crowd.
Denmark had goalkeeper Kasper Schmeichel to thank for pulling off a number of crucial saves during the game.
Leicester City goalkeeper Schmeichel pulled off superb stops to deny Granit Xhaka, Admir Mehmedi and Ricardo Rodriguez.
The result sees the Danes go level with Ireland at the top of Group D on 12 points, while Switzerland sit four points behind with a game in hand.
The Swiss will be hoping to recover by winning when they host Ireland in another big game for both sides on Tuesday.
Elsewhere in today’s Euro 2020 qualifiers, Romania took over second place in Group F following a 3-0 win in the Faroe Islands secured by second-half goals from George Puscas, Ionut Mitrita and Claudiu Keseru.
Sweden could move back above Romania with victory in Malta later although defeat would open the door for three-time European champions Spain to secure qualification with a win away to Norway.
Italy, who have six wins from six in Group J, can clinch their place at the finals with victory over Greece in Rome.
Bosnia and Herzegovina reignited their qualification hopes with a 4-1 win over second-placed Finland.
A brace from Juventus midfielder Miralem Pjanic and goals from Izet Hajrovic and Armin Hodzic pushed Bosnia to within two points of Finland, who could be joined by Armenia if they beat Liechtenstein in Vaduz.