Can I use the IR break beam sensor outdoor/indoor for 4-5 meters range?
The best ways to make a light beam system work reliably in uncontrolled lighting conditions is to look at these two things:


Try to arrange the receiver to have a tubular aperture in front of the detector that is aimed right at the transmitter. This will help the receiver to be much less affected by light reflections and outside sources.
Modulate the transmit beam by some scheme, either by a protocol or a validity window. Then make the receiving detector look of the protocol to know that the beam is present and valid. Obviously the data rate of the modulation needs to be higher than the object detect rate.