It looked as if it would be heartbreak for Tunisia when Mexican referee Cesar Ramos went to the pitchside monitor at the Education City Stadium.
Christian Eriksen's corner struck the arm of Yassine Meriah, but the ball had come off the chest of the Tunisia defender and referee Ramos stuck with his on-field decision.
Eriksen made a fairytale World Cup start with the Manchester United midfielder back at a major tournament 16 months after collapsing from a cardiac arrest at Euro 2020.
Denmark reached the semi-finals of that tournament without their talisman, and head coach Kasper Hjulmand said on Monday that his side had come to Qatar to win the World Cup.
But, for much of an absorbing contest, Denmark - ranked 10th in the world and 20 places above Tunisia - were knocked out of their stride by opponents with a point to prove.
This is Tunisia's fifth appearance at a World Cup and the Carthage Eagles have never gone beyond the group stage.
Tunisia could count on huge support with Doha home to a large Tunisian population and the north Africans created a raucous atmosphere, giving the feeling that this was an away game for Denmark.
The Danes' first objective was to silence the Tunisian fans and escape the shackles placed on their midfield trio Eriksen, Pierre-Emile Hojbjerg and Thomas Delaney.
Mohamed Drager gave the first sign of Tunisia's intent with a deflected shot that flew just wide with Kasper Schmeichel rooted to the spot.
Skipper Youssef Msakni headed over the resulting corner and Tunisia continued to press with the lively Issam Jebali a constant concern for the Denmark defence.
Jebali had the ball in the net midway through the first period, but he had just strayed offside from Dylan Bronn's pass and Tunisian celebrations were cut short.
Joachim Andersen and Hojbjerg forced routine stops from Ayman Dahmen in the Tunisia goal, but Denmark were fortunate not to fall behind two minutes before the interval.
This time there was no offside flag to deny Jebali as he went one-on-one with Schmeichel and attempted a dinked finish.
The ball looked as if it would float over Schmeichel's head but the former Leicester goalkeeper thrust up an arm to divert it around the post.
Tunisia applied more pressure at the start of the second half with pinball in the Danes' penalty area ending with Bronn's shot being deflected over.
Andreas Skov Olsen thought he had given Denmark the lead after 55 minutes when he drove home from 12 yards.
Mikkel Damsgaard, on a substitute for the injured Delaney, was well offside in the build-up but Denmark - and Eriksen in particular - slowly began to exert authority,
Kasper Dolberg headed wide and Eriksen's 20-yard effort was palmed away by Dahmen before Tunisia had an amazing escape.
Andreas Christensen directed Eriksen's corner back across goal and Andreas Cornelius somehow failed to bundle the ball over the line from a yard out, instead touching it against a post.
Denmark were camped in Tunisia territory during the closing stages, but could not find the winner that would have got them off to the perfect start in Group D.