The connection on the motor end is a small black cap and the upper end is red(?)( I'm color bind lol).
The black cap in your picture is Neutral Switch. Once on my G5, the wire attached to it had broken off
(picture below). It was soldered to the top of black plastic body of the neutral switch.
Your wire connector (beige color ?) seems to be something different, because that would not fit on the Neutral Switch. That may be side-stand switch connector.
Does your bike start in neutral or do you have to pull in clutch to start it ?