There is a wiring harness that connect
both the dome light and the light/rain
sensor.
On a base Mazda2, you only have a wiring harness that wires only the dome light. When you retrofit the sensor you also need to change that wiring harness. I assume your Mazda2 didn't come with sensor, hence why you're not finding the connector.
The harness runs from the front, where the dome light is, to the rear C pillar. When removing the C pillar, be wary of the yellow clip, it can
fall.
To avoid removing the headliner I ran the new wiring harness across the side of it. Since I did that and I had already glued the sensor to the windshield, the wiring was too short for the dome light. I had to pigtail the wires for connector of the dome light with the ones on the harness to make it longer.
When you're at the front, you need to
remove the
sun visor and the
dome light to run the wires and do the pigtail.
Hope this help and if you have any questions don't hesitate.