Luxembourg had won just three FIFA World Cup™ qualifiers in their history before this match, the last of them at home in 1972, but were full value for three points as Northern Ireland turned in a turgid display.
Martin Paterson had put his side ahead against the run of play and Gareth McAuley looked to have snatched a draw in the 82nd minute, but in between goals from Aurelien Joachim and Stefano Bensi gave a fairer representation of the match. So porous was the visiting defence that a winning goal felt almost inevitable and it arrived when Janisch poked his shot through a mass of bodies in the 87th minute.
For Northern Ireland manager Michael O'Neill, it will surely feel like much of the good work achieved in beating Russia last month and running Portugal close last week has now evaporated.
Northern Ireland almost cashed in on an under-hit back pass inside 30 seconds, Jamie Ward chasing down unsuccessfully, but otherwise the hosts looked in greater control in the opening stages. They had most of the early possession and Daniel Da Mota - a scorer in the 1-1 draw at Windsor Park - rode Oliver Norwood's challenge before bending a hopeful effort off target.
Lars Gerson headed a teasing corner wide before Bensi produced a mazy run into the box, but it was Northern Ireland who scored against the run of play. Shane Ferguson spotted a gap in the home defence and found the alert Paterson when he drifted into it. The Huddersfield striker took a touch to get the ball out of his feet and then finished emphatically with his left boot. It was the 26-year-old's third international goal and second in his last three appearances following his winner against Russia.
Ferguson's energy down the left seemed Northern Ireland's best option in greasy conditions, but Luxembourg continued to exert pressure. After Bensi found him waiting at the edge of the penalty area, Gerson opened his body and curled a shot against the crossbar with Roy Carroll beaten. It was a reminder for the visitors not to sit too deep when Luxembourg had possession.
McGinn was forced off with an injury ten minutes before half-time, with Rotherham's Michael O'Connor summoned from the bench for his first cap in three years.
Bensi continued his impressive showing with a powerful shot that required a smart reflex save from Carroll, and with the referee seconds away from blowing for half-time, Luxembourg effected a classic counter-attack on the back of two Northern Ireland corners. Joachim was the outlet, peeling off Jonny Evans and Daniel Lafferty before his shot looped off the latter and into the net.
Luxembourg came out with visible intent after the break, setting up camp in the Northern Ireland half for five uninterrupted minutes. One elaborate corner routine, involving a cheeky stepover, left Mario Mutsch with a sight of goal but he could not direct his shot through a crowd of bodies.
Yet Luxembourg sensed blood. Northern Irish nerves were palpable when Carroll chested McAuley's back-pass and then handled under pressure from Bensi, giving away an indirect free-kick inside the area. The ball was touched to Bensi, whose powerful shot flew just wide of the far post.
With an hour gone Inverness forward Billy McKay was handed a competitive debut off the bench, Ferguson making way as O'Neill committed more men to attack. McKay had a chance to make his mark in the 69th minute, latching on to Paterson's clever reverse flick inside the six yards box. But while his touch took the ball past the goalkeeper it also forced him wider than he would have liked, and the resulting shot thudded into the side netting.
Luxembourg's momentum was waning but they received the biggest boost of all when they took the lead with 12 minutes remaining. Antonio Luisi did well to cushion a long ball on his chest, feeding the advancing Bensi who raced forward as the defence dropped deep. He got within 25 yards before pulling the trigger, beating Carroll with a superb drive into the bottom corner.
The equaliser, four minutes later, was less cultured but no less effective - McAuley getting on the end of Norwood's free-kick and seeing his downward header creep in at the far post.
Northern Ireland had lost all sense of shape now and Luxembourg could have won it when Luisi saw a certain goal charged down by Evans at the final moment. The winner still seemed likely though, and arrived in the 87th minute when Janisch stabbed home from close range following another defensive meltdown.