Daniel Vettori played a captain's innings with his second Test century helping New Zealand to a decent first innings score of 356 at the second Test.
Pakistan ended day two at the Basin Reserve in Wellington on 134-2 in response, trailing by 222 runs with eight wickets in hand, after Vettori's knock of 110, off 166 balls, had bolstered the home side's first innings score.
New Zealand then enjoyed the perfect start with the ball when Mohammad Hafeez was controversially out with just two on the board, as the hosts looked to avenge their crushing 10-wicket defeat in the first Test at Hamilton.
However, Taufeeq and Azhar scored 70 and 62 respectively, and shared a second-wicket stand of 132, before the former was out from the final delivery of the day, caught by Martin Guptill off the bowling of Vettori.
After resuming on 246-6, Vettori and Reece Young made a cautious start, with the captain reaching his half-century when he clipped Gul to the leg side for two, before Young then reached his 50 with a boundary off Tanvir Ahmed to take the hosts past 300.
The score had moved on to 318 when the partnership was brought to an end shortly before lunch when Young became wicketkeeper Adnan Akmal's sixth catch of the innings.
Tanvir sent down a short, wide delivery close to Young and he snicked it through to Adnan to end his innings on 57, including six boundaries off 162 deliveries, and sharing a vital stand of 138 with Vettori.
Tim Southee came to the crease and made just one before being caught by Misbah-ul-Haq off Umar Gul.
Brent Arnel became Gul's second victim of the day, lbw for one, before Vettori fell as the hosts' innings came to an end, holing out off Rehman to be caught by Misbah.
New Zealand's attack then enjoyed a perfect start when Hafeez was contentiously given out off Southee having made just one.
He launched at the drive and there was a noise as the ball went through to the keeper and the umpire immediately gave him out. However, replays were inconclusive as to whether Hafeez hit the ball, although his bat definitely hit the pad.
Taufeeq and Azhar came together and made steady progress from the off, with the pair continuing their progress after lunch as Azhar hit Vettori for six over long-on before bringing up his 50 when he sent a delivery to deep cover.
Taufeeq then took his side to 100 when he steered the ball to deep backward point off Chris Martin, before moving on to 50 himself with a shot to mid-off for his second half-century in two Tests.
Taufeeq then turned on the power, but he was out off Vettori when he stabbed at a delivery outside off stump which he prodded to Guptill at second slip.
His innings of 70 included 12 fours and came off 143 deliveries, while Azhar's unbeaten 61 came off 148 deliveries and included seven fours and one six.