Team Melli had been cruising at 2-0 but were more than relieved to hear the final whistle at the Azadi Stadium as the visitors hit back and almost snatched a point.
The Koreans are famed throughout Asia for a tight defence but it was breached after just nine minutes as Mahdavikia headed home.
Iran continued their good start and were on top for the rest of the half, although North Korea looked threatening at times.
The game looked to be over just after the hour as Nekounam extended Iran’s lead with a goal made in Spain.
The Osasuna star was found by club colleague Masoud Shojaei inside the area and he finished from close range.
With 19 minutes remaining, Jong Tae-se pulled a goal back for North Korea and with time running out, Jong as well as Hong Yong-jo went close to what would have been a precious equalizer.
Now four teams have four points in Group Two, although North Korea have played a game more than Iran, Saudi Arabia and South Korea.