unless you can find a part number I would just order a unit that has the correct number of leads and give it a try, looks like your example has heavy wear on it so a new un-worn may rub against the whatever breaks the opto path
heres one i saw on marcos site that may be a possible replacement ... its prolly all about size and lead numbers tho, hope this helps
https://www.marcospecialties.com/pinball-parts/5490-12451-00