It will go to a plug, depending on what model car ,cant tell you where the plug will be. I assume a 3 series or V12? Only because of 6 wires. If a V12 look just under the Oil Filler, there are 4 plugs, 2 for crank sensors and 2 for the speed/signal sensors.
Look for the cable coming from the crank sensor and there will probably be an empty plug where that one should go. Car should'nt start with out it as its the speed/signal sensor. Square Plug with normally 3 flat pins.