From CDC:
The typical incubation period for influenza is 1—4 days (average: 2 days). Most healthy adults may be able to infect others beginning 1 day before symptoms develop and up to 5 to 7 days after becoming sick
The incubation period is the time gap between the entry of a microorganism in our body and development of sign/symptoms. According to CDC, it may be as short as 1 day! So there is no strict timeline for 5 days as you have heard.
Also, even before you start suffering (having symptoms) yourself, you can infect others.