If a party to a lawsuit does not agree with the jurisdiction of the court it must
If a party to a lawsuit does not agree with the jurisdiction of the court it must file a motion to dismiss the case. Because this is a procedural question solely the judge will decide on such a motion. In the movie "A Civil Action" you witness the defendants' attorneys file motions to dismiss on other grounds.
But getting back to subject matter jurisdiction: why would a party to a lawsuit even care about subject matter jurisdiction?