The rain sensor in a vehicle is a non conductive rain sensor. Boats, weather stations and basement water detectors work on a conductive (resistive) method knowing that water conducts some amount of electricity between the contacts... but back to the automotive non conductive version...
The sensor in your car is nothing more than a IR emitter and detector pair that monitors for changing environmental conditions. In order to detect those conditions the windshield is needed as it reflects back some amount of the IR thus the mounting position on the dashboard or Rear View mirror. As rain lands on the windshield the reflectivity changes causing more of the IR to be reflected back due to the obstruction.
So you should easily be able to build one using a standard IR xmit/recv sensor, but you'll need something to act as the windshield like a plastic dome of some type.
Here is a commercial one:
Hydreon Optical Rain Sensor
The other option is go to your local Mercedes or BMW dealer and try to buy the replacement sensor which you can likely connect to an analog input. You'll just need the plastic dome to make it work.