You would treat the background as a separate class, thus your target mask will have values in the range [0, 4].
[0, 4]