You can count the players before you inbound the ball. But, hey, we all make mistakes . . . and five is such a big number.
It is the coach's responsibility to keep track of his/her players. Personally, I think you did what you could and what you had to.