Knicks beat Pacers to stay alive