A North Carolina appeals court has sided with the trailing candidate in a close state Supreme Court election from November.