But as others have said, to know whether or not the 5 W resistor will overheat, you need to know the frequency (or rather the period, 1/f) to know for how long the maximum power of 8.8 Watts will be on. If you have, say, a period of 100 seconds (16.7 seconds at 8.8 Watts) ..... then yes, the resistor will probably overheat. If you have a period of 0.1 second, then no, it probably won't overheat. Just where the line is between Yes and No depends on other variables. Is the resistor mounted directly on a circuit board or is it on "standoffs" so that air can circulate around it? Is there fan-forced cooling or only convection? Etc. Etc.
IOW, it's a bad question.