Thats the the knock sensor plug, the one you need a hand the size of a 6 year old attached to an arm that has an extra joint between the wrist and elbow to get at lol.
You will need a new sensor, part number is 89615-22040, its available from other cars than a Starlet, check it out on the parts reference on Toyodiy. Plug looks ok, just check the wire is not damaged, its only 1 wire with a shield. I put in a plug and socket just after the end of the fuel rail harness so it can be disconnected there rather than down at the sensor.