I am allergic to penicillin, can other antibiotics be used to treat syphilis?

Yes. It is known that 60-70% of those thought penicillin allergic are not, skin testing in a protected setting can usually provide more accurate status. Nontheless, the drug Doxycycline given over a 2 wk period may cure syphillis, Azithromycin has been used but some resistant strains have been found. Penicillin is the only drug known effective during pregnancy & can be used with rapid desensitization.
Penicillin is best. Depending on your history of penicillin allergy, you may need to be desensitized to penicillin prior to treatment. I would first recommend consultation with an infectious disease specialist to determine potential alternative treatments.

Related Questions

Can a10 day course of non-penicillin antibiotics orally to treat Strep throat unknowingly cure/treat primary or secondary syphilis?

Here are some. .. I would not contemplate the possible effective Rx for asymptomatic syphilis. If you think you're in a high risk for syphilis due to personal lifestyle, just do inexpensive indirect serological test first (VDRL or RPR) ; if (+), do direct confirming serological test (FTA-ABS test). So, ask Doc timely for detail.