David Healy scored his first international goal in four years with a 96th minute free-kick to secure a 1-1 draw at Windor Park in World Cup qualifying Group F after Rauf Aliyev had given Berti Vogts' side a shock lead.
Azerbaijan had lost 43 of their previous 46 international away games, but Aliyev stunned the home side by scoring the opening goal of the game with a stunning 30-yarder after just five minutes.
He collected Javid Huseynov's pass before hitting a superb left-foot curler into the bottom corner past a stunned Roy Carroll.
Northern Ireland should have restored parity as Craig Cathcart somehow headed Dean Shiels cross wide of the post.
And just before the break Daniel Lafferty missed glorious chances when he headed Shane Ferguson's stunning left-wing cross over the crossbar.
Chris Baird was guilty of missing a couple more glorious chances after the interval.
But deep into stoppage time substitute Healy was the hero when he slammed home his 36th international goal with a free-kick from the edge of the box to the relief of the home faithful.
The Bury man averted what would have been an embarrassing defeat although the result leaves Northern Ireland with three points from four games and all but out of the reckoning.
The point is unlikely to be enough to rescue Northern Ireland's slim qualifying hopes but it did save Michael O'Neill's side from one of their most ignominious defeats.
It also consigned last month's heroic draw in Portugal firmly to the history books
|Northern Ireland||Team Statistics||Azerbaijan|
|0||1st Half Goals||1|
|6||Shots on Target||5|
|12||Shots off Target||3|
|62.7||1st Half Poss.||37.3|
|67.1||2nd Half Poss.||32.9|