There is no risk for syphilis, or any other STD, from this.
STIs require sexual activity to transmit - hence, the sexual transmitted part of sexually transmitted infection.
The only way to get STIs are:
* oral sex - your mouth on someone's genitals, or their mouth on your genitals. Some STIs require penetration, as in the penis being inserted into the mouth.
* direct genital to genital contact - this is unclothed vagina to penis, penis to penis, vagina to vagina contact, or penis to anus contact. If penetration isn't involved, some intense rubbing and grinding without clothes on needs to happen.
* vaginal sex - penis in the vagina penetration, or intense rubbing or grinding of the penis against the vagina.
* anal sex - penis in the anus penetration, or intense rubbing or grinding of the penis against the anus.
All of these require clothes to be off of all people involved, and condoms reduce the risk of STIs either totally, or significantly, depending on the STI.