Sounds like you have a Korg pedal, and are using it on a Yamaha keyboard.
The difference is not polarity, but state.
The Korg is "always on", and pressing it breaks the contact (which triggers the sustain function).
The Yamaha is "always off", and *makes* contact to trigger the function.
Most third-party pedals have a switch to change from one state to the other. If yours doesn't, then you may have to open it up and do some soldering. Or just return it and get the right one.
BTW - "sustain pedals" are really just plain old switches - there are no electronics involved. Just a plain, non-latching "on/off" switch (like your door bell button). In fact, you can use a door bell button and a cable to create a sustain switch for most Yamahas.