That is perfect.
You want a little extra space in your primary to reduce chances that the krauzen (foam produced by fermentation) bursts through your airlock. Once primary fermentation is done, transferring to a 5gal secondary is totally ok.
Something to think about, a lot of people around homebretalk don't secondary at all, and instead leave it in primary for +/- 3 weeks to minimise chances of infection (less moving/less equipment = less chance of infection)
A little irreverence is good for the soul