Thomas Lam opened the scoring for the Dutch side but his effort was quickly cancelled out by Martinez Lucas as the wrangle to finish as group winners brought out the fighting spirit in PAOK.
Several attempts from both sides failed to find the target but Donny Gorter put AZ back ahead from the penalty spot in the 71st minute.
Stelios Pozoglou had the final word, however, when he scored in the fourth minute of stoppage time to level the scores again, but it was not enough to stop AZ from going top on a better away goal record.
The two sides had been level on 11 points and had both already qualified for the round of 32, and after drawing their first meeting and finishing on the same goal difference they had to be separated by the finest of margins, with AZ having conceded two less goals than their opponents.
Thursday's game started well for the Dutch side as Lam put AZ ahead in the 31st minute when he turned sharply in the right of the area to fire Willy Overtoom's ball in across goal where it ricocheted in off the far post.
However, the lead was short-lived as Fernando Lewis fouled PAOK midfielder Stelios Kitsiou to give away a penalty, which Martinez Lucas scored five minutes after the opening goal.
AZ keeper Yves De Winter denied Stefanos Athanasiadis' strike just before half-time and PAOK keeper Panagiotis Glykos kept his side in the match with two good saves early in the second-half.
Johann Berg Gudmundsson was the next to try his luck only to see his strike from the left of the area blocked by Glykos
However, AZ did find another breakthrough but this time from the penalty spot after Costin Lazar handled the ball in the area.
Gorter stepped up and drilled the ball past Glykos as the Eredivisie side claimed the lead for the second time in the game.
Aron Johannsson then fired over the bar for AZ before De Winter made a comfortable save from Miguel Vitor's header from a corner at the other end.
Pozoglou scored the equaliser just before the final whistle but it was not enough for the Greek side to finish top of the group.