No, A ground invasion is not required for something to be considered a war. If two countries engage in sustained military attacks through missiles, drones, or airstrikes, it can be described as a war, even without occupying each other’s territory.
For example, if Russia and the US were fighting today using missiles, rockets, drones and air warfare, but neither side invaded the other’s territory, it would still be considered a war.
And if people start making excuses like, “You started the war, so we don’t have to support you,” then such a military treaty becomes practically useless, because there will always be some excuse to avoid honoring it.