Emergency defined as per The United States Code Title 42, Chapter 68, Subchapter I, §5122 -
Emergency means any occasion or instance for which, in the determination of the President, Federal assistance is needed to supplement State and local efforts and capabilities to save lives and to protect property and public health and safety, or to lessen or avert the threat of a catastrophe in any part of the United States.
The President is on firm legal grounds.
Trump may be on firm legal ground. That wont stop the Democrats shopping for a judge who will issue an injunction.