Ten minutes after substitute Gavin Whyte had given Northern Ireland hope with the equaliser, the Cardiff winger sent in the cross for Magennis to power home a much-needed winner for Northern Ireland and their manager Ian Baraclough.
An afternoon that began with Conor McMenamin becoming the second player in as many days to be sent home from the squad due to a video circulating online threatened to get much worse after Vedat Muriqi’s 58th-minute strike had fans once again calling for the manager’s head.
But instead Northern Ireland claimed three points in this competition for the first time in 15 attempts, moving clear of the immediate threat of relegation to the bottom tier.
After a miserable run of results in June had left his side in a perilous position, Baraclough had sought to inject optimism this week, talking up the return of key players who missed those summer fixtures.
It was reflected on a team sheet which showed eight changes from the 2-2 draw with Cyprus here three and a half months ago, with Jamal Lewis making his first appearance since last November and the likes of Corry Evans, Tom Flanagan and Magennis back in the fold.
But there was no McMenamin on the teamsheet, and less than an hour before kick-off the Irish FA announced the 27-year-old, who only made his debut in June, had been sent home after a video emerged appearing to show the Glentoran winger singing a pro-IRA slogan.
That came a day after Kyle Lafferty had been sent home amid an investigation by his club Kilmarnock into a video appearing to show him using alleged sectarian language.
The miserable mood continued as Kosovo, 3-2 winners over Northern Ireland in Pristina earlier this year, threatened early on.
Bailey Peacock-Farrell could not hold Florent Muslija’s shot and was grateful to see Milot Rashica scuff the follow-up, before then denying Rashica again and seeing Fidan Aliti hook a shot over.
It took 15 minutes for Northern Ireland to threaten, with Betim Fazliji almost turning the ball into his own net after Magennis sent Paddy McNair’s cross goalwards.
There was a better chance shortly before the break as Dion Charles – making his first start as he won a 12th cap – broke clear of Fazliji but then placed his shot too close to goalkeeper Ari Muric – the man who keeps Peacock-Farrell on the bench at Burnley.
At the start of the second half George Saville slipped the ball through to Conor Bradley, who neatly turned inside to get away from his defender but then could not get enough power into a left-footed shot.
Charles had the ball in the net in the 55th minute after Saville played a ball down the middle, but the Bolton striker was denied his first international goal as he was well offside.
And it got much worse for Northern Ireland just three minutes later as Kosovo’s record goalscorer Muriqi found the bottom corner with a crisp shot from the edge of the area.
Northern Ireland rallied. Muriqi blocked Jonny Evans’ header on the line, then Muric kept out a looping effort from Magennis.
Peacock-Farrell then made a vital save to deny Muriqi what would have been the killer blow, and moments later Northern Ireland were level as Shayne Lavery, just on as a substitute, wriggled free of Fazliji and ran towards goal, finding traffic but squaring the ball for fellow replacement Whyte to fire home.
Peacock-Farrell made another save to deny Zymer Bytyqi and Magennis capitalised at the death.