You could, but I presume the elevator also goes down. So there should be similar code for moving the stepper in the opposite direction.
On the other hand I was thinking of still using hall sensor(s) (you could use one sensor on the elevator or one per floor, depending the available IO pins) to detect the elevator actually passing by a floor. However, you'd have a couple of flag variables; e.g. one set to "true" when the motor turns clockwise and the other set to "true" when it moves counter clockwise. Then you have an conditional blocks similar to below...
if (sensorTrigged == true)
if (clockwise == true && counterclockwise == false) floorNumber = floorNumber++; //check both flags to rule out some potential errors
if (clockwise == false && counterclockwise == true) floorNumber = floorNumber--;