Tries from British & Irish Lions captain Brian O'Driscoll and Andrew Trimble had given the Irish real hope of a first success over the All Blacks in 101 years of competition.
Ireland made a dreadful start as Doug Howlett crossed for a New Zealand try in the first minute.
McAlister missed the conversion and a penalty shot soon after and Ireland responded with O'Driscoll going over after 11 minutes.
Ronan O'Gara converted and then put Ireland 10-5 ahead but a successful McAlister penalty reduced their advantage.
O'Gara added two more penalties to give the tourists a 16-8 lead at the break but New Zealand started the second half as strongly as they did the first.
Mils Muliaina rounded off a fine move with his side's second try but again Ireland were unbowed with O'Gara setting up Trimble for a converted try.
New Zealand, however, were not to be denied with two penalties around the hour mark from McAlister bringing them right back into it.
He added another in the 71st minute to put the All Blacks back ahead and they made sure of the win with Flavell's try after Muliaina intercepted a Paul O'Connell pass.