Isaac Price scored his second goal for Northern Ireland.
Michael O’Neill’s men completed the season on a positive note with to second-half goals from Isaac Price and Dion Charles.
Charles hit the post early on, but NI goalkeeper Conor Hazard saved him twice before the break.
Before Monday’s encounter, Denmark had already qualified for the Euro championships.
Denmark qualified for the finals after defeating Slovenia on Friday, and they rested a few key players for the match at Windsor Park, including Manchester United duo Rasmus Hjlund and Christian Eriksen.
That didn’t make Northern Ireland’s much-needed victory any less delicious, with the Green and White Army springing into life for the majority of the second half of a game in which little more than pride was at stake.
It had been seven defeats in nine games for Northern Ireland, who have generally been young and inexperienced this season, with their only prior points coming from two wins over tiny San Marino.