Here's what I found:
Brown is always ground, goes w/o saying. White-green only appears on the '96 E36 (except M3) schematics, and is shown as "PROG VOLTAGE" for the transmission control module (EGS). I assume it is for functions that you don't have on your car. But I don't know why you'd have the harness in the 1st place . . either your DME or tranny was replaced?
Also, some auto transmissions had a speed sensor located at the top of the tranny. Not necessarily related to the speedometer; it may be for the tranny electronics for shifting purposes, I'm not sure. But the Bentley's tranny removal instructions say to unplug it, if applicable. So that means you may or may not have the receptacle at the top of the tranny.
In either case, who knows why the harness is there; looks like you may have a "Frankenstein" car (different parts repaired/replaced from different years). But but if everything works, then I'd leave it as is.