New Zealand were 307-8 after at one stage being on track to better 350 before Australia knocked the run charge off line.
McCullum, who retires from international cricket after the Australian series, produced a typical whirlwind innings of 44 off 29 in his last appearance in Auckland and the crowd rose and applauded as he left the field.
But Guptill (90) and Nicholls (61) with a 100-run stand for the third wicket ensured New Zealand had an innings of substance before Australia clawed their way back into the game.
When New Zealand reached 181-2 halfway through the innings they had Australia on the ropes, but the game turned after Guptill's dismissal. Four wickets fell for 53 runs in 12 overs as the New Zealand middle order fell apart.
After being sent into bat, there was never any suggestion of the 34-year-old McCullum playing for safety against New Zealand's closest rivals in their first ODI since Australia won the World Cup final last year.
But New Zealand had some heart-stopping moments when he put his reputation as a ruthless batsman on display from the start. For the first eight deliveries he faced, McCullum swung in vain and was repeatedly a whisker from delivering a catch opportunity.

Latest News from Sports News Desk