The statute reads (emphasis mine):
A person is guilty of adultery when he engages in sexual intercourse with another person at a time when he has a living spouse, or the other person has a living spouse.
Suppose Alvin has sex with Betty while Betty is married to Charlie. Does Alvin's conduct satisfy the elements of the crime?
Alvin engaged in sexual intercourse with another person (namely Betty)
at a time when the other person (Betty again)
had a living spouse (namely Charlie).
So yes, Alvin has violated this law.
Betty has also violated the law (the first clause instead of the second).
Betty engaged in sexual intercourse with another person (Alvin)
at a time when he (Betty; the pronoun "he" is meant to be gender-neutral in the statute's style of writing)
had a living spouse (Charlie).
However, this law is effectively unenforced in modern times. According to https://www.dbnylaw.com/adultery-is-still-a-crime-in-new-york-state/:
It is extremely rare for anyone to be arrested just for adultery. Indeed, since 1972, only 13 persons have been charged with adultery. Of those 13 persons, only five actually were convicted of the crime. In virtually every one of those cases, there was some other crime that was committed and the prosecuting attorney added adultery as just one of many crimes committed.
If Charlie files a complaint regarding the affair, it is almost certain that the police and prosecutors will ignore it, and that nobody will actually be charged with anything.