If 五日 is a date and 五日間 refers to a span of 5 days, shouldn't one say 五日間前？ As another example I found, 「三日以内に書類を提出してください」Wouldn't this mean "within the third", which doesn't make sense. Should it not be 三日間以内?
The reason that 三日間以内 or 五日間前 do not work is that it is essentially repeating the same thing.
間 means the 'interval' or 'timeframe'. 以内 means 'within', which is very similar. If you use both, it doubles the meaning and makes it extremely confusing.
In the case of 五日前, it translates to '5 days before', which is what we want, instead of 五日間前 translating to '5 days interval before'.
On the other hand, 三日以内 is 'Within 3 days', instead of 三日間以内 which changes to 'Within the period of 3 days'.
In both examples, the second would technically work, but it overloads the sentence and unnecessarily complicate it.
I hope this helps. Please notify me if you would need more of an explanation, or if I can clarify anything!