Carter later joined the team as they entered the school hall to cheers.
Interviewed afterwards, one of the St Mary's College team members said: "We walked on to the pitch and we could only see the back of some guy. I thought it was [Irish first five-eighth] Jonny Sexton. But it was Dan Carter ... It was unbelievable."
The school later tweeted a photo of Carter with members of the team and said: "Very privileged to have you in St. Mary's today. Thank you for your words of wisdom to the boys."
He also received one of the school's rugby jerseys with his name on the back.
Carter replied: "Your big team are making me look tiny. Great to meet them all today."
Carter is living and playing rugby in Paris for professional French club side Racing Metro.