I installed the stock from my HK 416 onto my C8 carbine, and it's all in pieces right now, so it's no problem to do this.
In this first pic, I have the leads coming out the rear of the mechbox. I just noticed in your pic, your wiring has a tamiya connector right at the mechbox. You won't be able to fit that into the stock. You're going to have to solder a longer wire in order to be able to fit yours. But this is what I have on mine.
In this next pic, I've disconnected the mechbox leads from the battery leads. They're installed with these little connectors.
Here I've threaded the wires through the small hole in my stock ring (or whatever it's called) / sling loop.
I've now run the battery lead down my stock tube
I've not made the connection of the mechbox leads to the battery leads, and I'm sliding the stock tube onto the buffer tube. Note the small notch in the stock tube that the wires are in. There' plenty of space to run wires through here.
Now the stock tube is compeltely attached and only needs to be attached using the bolt and washer.
Note that the washer used for crane stocks is not totally circular and has a 'flat spot' to allow the wiring to run down the stock tube without being pinched.
As I mentioned earlier, from seeing that tamiya connector right at the rear of the mechbox, you may need to do a little more work before you can finish the install.