output impedance of the signal generator you use to generate the square wave. When you set it to low, output impedance of the signal generator builds a voltage divider together with the internal pull up, and the device ends up sensing a higher voltage than "low". This is something you can see if you have an oscilloscope, try to hook up a probe to the input and ensure whether you get what you set in the signal generator.
some signal sources have no or limited capacity to drain current. And when you set it to low, this is exactly what it us supposed to do, drain current from the internal pullup.
As you mentioned in another comment, solution is a simple buffer. This could be an opamp, but even a simple nmos transistor should suffice (open drain as you said). But you need yo be careful with current ratings of the transistor, which you can easily calculate by dividing 5V by the pull up resistor. Send a message if you need help.
Before these, I suggest you yo use an oscilloscope or multimeter to measure the voltage when it is supposed to be low, and see that in fact the problem is that voltage at the input doesn't go "low".