No, you do not need to put on excessive amounts of body fat to increase your muscle mass. In fact, a common mistake is that people mistakenly believe they need to eat an enormous surplus of calories to gain muscle tissue.
However, this is likely to result in you gaining just as much muscle mass as if you were in a moderate surplus or maintenance, but with a lot more fat! When you then diet down to reveal the additional muscle, you’re likely to lose the marginal gains as a by-product of fat loss. Increasing body fat also makes you liable to be less metabolically healthy, which has zero advantages, whether from a health, training performance or nutritional perspective.