are you using an opto isolated breakout board , this usualy inverts the signal , or could be that the pin is pulled high by a resistor to your 5v , modifying the board by removing the resistor or swapping it to 0v instead of 5v may help , let us have more information on your breakout board etc
Dave