This isn't an easy question https://www.mattmillman.com/info/crimpconnectors/common-jst-connector-types/
Your 2nd best bet would be to get the pin spacing, and filter your search using that.
Your first best bet would be to just replace both ends.
I settled on a 'standard' and just bought a massive kit of each of those connector types- wire-wire, wire-board, wire-panel in M and F, in various pole counts. Buy once, cry once.
A 2-pin connector?
Yes, 2 pins.
I think they're saying that's generally what it's called.
Molex 51021 or similar. Could you measure the pin pitch?
Why not just splice the wire?
This is by far the best option for awkward connectors. You could even remove the pins and put the new cables in by opening the crimp and soldering the new ones without any splice.
Ask Electronics
For questions about component-level electronic circuits, tools and equipment.
Rules
1: Be nice.
2: Be on-topic (eg: Electronic, not electrical).
3: No commercial stuff, buying, selling or valuations.
4: Be safe.