I’m probably making the boring, obvious comment here, but your base aerobic fitness is also super important. This will help with recovery between each of the hilly 5 min efforts and also allow you keep riding hard between hills (presuming it isn’t all just straight downhill between hills) and not let up completely.
A good base will help to make each 5 minute effort a lot more consistent too.