This should do it:
Pin1 (closest to mounting stem) - 12Vdc ignition
Pin2 - ground
Pin3 - 12Vdc when in reverse ( clears mirror if it's dimming) you don't really need to connect this one.
Pin4 - output to outside mirror dimming
Pin5 - output to outside mirror dimming
Pins 4&5 are used for outside dimming mirrors if equiped. 12v to pins 4&5 (furthest from mounting stem) will destroy the mirror. You only need pins 1 & 2 for most retrofits.