Denmark had the quality to put France down to 2-0 in Copenhagen, ending their 12-match unbeaten run.
France finished one point above relegated Austria, who lost 3-1 to Croatia on Sunday.
Denmark had to win and hope that Croatia failed to beat Austria to reach next summer’s finals.
Kasper Dolberg and Andreas Skov Olsen scored first-half goals for the hosts in Copenhagen.
World champions France, who beat Spain 2-1 in last year’s Nations League final, ended a four-game winless run and moved off the bottom of the group by beating Austria on Thursday.
Denmark started the game on the front foot, but they failed to capitalise on their early pressure.
France grew into the game and came close to opening the scoring when a corner found its way to Kylian Mbappe. But the Paris Saint-Germain striker was denied by Kasper Schmeichel.
The OGC Nice goalie was called into action again to keep out Antoine Griezmann after some intricate play with Mbappe.
Requiring victory to be certain of their top-tier status in the competition, Kylian Mbappe forced Kasper Schmeichel into action following a corner as France applied early pressure at Parken Stadium.
Christian Eriksen was instrumental as Denmark began to offer more of a threat, but Skov Olsen was flagged offside following a sublime ball over the top by the Manchester United midfielder.
Eriksen found Mikkel Damsgaard on the right to set up Dolberg’s breakthrough, the striker sliding in to meet the Brentford winger’s low cross.
Alphonse Areola initially prevented further damage, making saves from Joakim Maehle and Thomas Delaney, but Skov Olsen’s superb volley from the edge of the box flew through a crowded penalty area to double the advantage.
Denmark missed the chance to seal their place in the finals on Thursday as defeat by Croatia put their opponents in pole position.
Schmeichel was in fine form to deny Mbappe three times in as many minutes as Kasper Hjulmand’s side earned the win they required on the night, but it was not enough as Croatia scored two second-half goals to finish top by one point.