Depending on the year of the YJ tub will determine what wire does what.
We know there is one wire each for the tail, and back up lights, and 2 for the brake/ signal lights. There should also be one for the fuel gauge. There will also be 2 more for the dome light and rear wiper( if its new enough)
The easiest way to find what is what is to run a wire from the postive battery terminal to the YJ wires. Then (if the tub is grounded (12volts negative) touch each wire and see what lights up. Right down the color and what lights came on, on a piece of paper. Then connect them to the CJ wiring.
1957 WILLYS pickup,
1973 J 4000,
1978 CJ7 DD.
1979 CJ7 360, TH400/Quadratrac.
1980 CJ5 trail Jeep.
1989 YJ the CJ to YJ.