Well, the black and red wire, at least, may be for a rear work light option. My DKse's both had these extra wires in the back, I believe the fuse box even said "working Lamp". Volt meter confirmed. But I'm sure someone with an NX will chime in soon.
Actually, looking at a wiring diagram i have here, it may be from your left hand turn signal (2 wires) and tail lamp, (harness)
Keep in mind this little diagram is from an EX tractor, similar to a DKse, but in Australia. Just happens to be what I have.
If I'm looking at the correct diagram (big if) it shows a working lamp for the bayonet connectors, a beacon lamp for the oval connector, and the interface for a 7-way trailer socket for the square connector.