Richard,
I had to do something similar, and to do it, there is a pin diagram somewhere that says pin B is this, D is that, etc. I used a multimeter to trace out the wiring, to find the ground, left, right, marker. Only 4 really need to be connected, unless you plan to tow in blackout conditions.