It won't hurt doing it, but I'd do more like 6 gallons because unfiltered water is in the hoses between the filter and the tap you are draining it at.
Although the filtered water is safe to drink admittedly we have never drunk it - we carry two 5 gallon water containers and get them filled in grocery stores or walmart for about $.35/gal, for drinking and cooking. We also add a portable water filter at the RV site faucet in addition to the built-in filter in the bay. There is no right or wrong, just DW insists doing so.