Right, your '02 door harness has the 5 pin connector at the mirror, and you got a '98 or earlier door harness (with 3 pins).
I installed '99 heated mirrors into my '97, and did the conversion of the wiring harness connector from 3 pins to 5 pins. If I recall correctly, the harnesses have other significant differences (other than the 5 vs 3 pin mirror connector), so you cannot easily use an early harness in a later vehicle. I know that because I took the entire '99 door harness with the mirror, planning to use it in my '97, but the connectors at the body were completely different. So I used the earlier harness, and ran two additional wires for the mirror heater.
So I agree, your best bet is to pull the original harness from the damaged door, and put it into the new door. It's a pain, but probably the easiest path forward at this point.