To expand on Math Man's answer, the proof of this theorem depends on an important corollary: A polynomial with degree of at most n with more then n roots must be the zero polynomial.
With this the proof is simple and was outlined above:
We form a new polynomial, G(z) say, such that
G(z) = p1(z) - p2(z)
now it is given that p1(z) and p2(z) are equal at more than n values. lets call these points q1,q2,...qk where k>n
Obviously G(q1)=G(q2)=...=G(qk)=0,
ie, G has more than n roots but since G = p1 - p2, it is of most n degree. So by our corollary we conclude G is the zero polynomial
or that p1(z) - p2(z) = 0 or p1(z) = p2(z).