Example 7 Let $S=\{1,2, \cdots, 98\}$. Find the smallest positive integer $n$, such that in any $n$-element subset of $S$, one can always select 10 numbers, and no matter how these 10 numbers are divided into two groups, there is always one group in which there is a number that is coprime with the other four numbers, and in the other group, there is always a number that is not coprime with the other four numbers.
The subset of 49 even numbers in set $S$ obviously does not satisfy the coprime condition, hence $n \geqslant 50$.

To prove that any 50-element subset $T$ of set $S$ contains 10 numbers that satisfy the condition, we use the following facts.

Lemma 1 If nine elements in $T$ have a common factor greater than 1, and there is another element $x$ that is coprime with all of them, then these 10 numbers satisfy the condition.

Lemma 2 If the number of even elements in $T$ is $E(T)$, and there exists an odd element $x$ in $T$ such that the number of even elements in $T$ that are not coprime with $x$ is $f(x) \leqslant E(T)-9$, then $T$ contains 10 numbers that satisfy the condition.

Let $P_{1}=\{1,53,59,61,67,71,73,79,83,89,97\}$ (1 and the primes in set $S$ greater than 50), $\left|P_{1}\right|=11$, $P_{2}=\{13,17,19,23,29,31,37,41,43,47\}$ (primes greater than 11 and less than 50), $\left|P_{2}\right|=10$, $P_{3}=\{5,7,11\}$, $\left|P_{3}\right|=3$.

Since set $S$ contains only 49 even numbers, $T$ must contain odd numbers.
(1) If $T$ contains $x \in P_{1}$, $x$ is coprime with all other numbers in set $S$. Since there are 33 numbers in set $S$ that are neither divisible by 2 nor by 3, $T$ must contain at least $50-33=17$ numbers that are divisible by 2 or 3, among which there must be nine numbers that have a common factor of 2 or 3. $x$ is coprime with these nine numbers.
By Lemma 1, $T$ contains 10 numbers that satisfy the condition.
(2) If $T$ does not contain elements from $P_{1}$ but contains $x \in P_{2}$, $f(x) \leqslant\left[\frac{98}{2 \times 13}\right]=3$. Since $T$ contains no more than $49-11=38$ odd numbers, hence
$$
E(T) \geqslant 50-38=12 \geqslant f(x)+9.
$$

By Lemma 2, $T$ contains 10 numbers that satisfy the condition.
(3) If $T$ does not contain elements from $P_{1} \cup P_{2}$ but contains $x \in P_{3}$, $f(x) \leqslant\left[\frac{98}{2 \times 5}\right]=9$. In this case, $T$ contains no more than $49-11-10=28$ odd numbers, hence
$$
E(T) \geqslant 50-28=22>f(x)+9.
$$
$T$ also contains 10 numbers that satisfy the condition.
(4) If $T$ does not contain elements from $P_{1} \cup P_{2} \cup P_{3}$, $T$ contains no more than $49-11-10-3=25$ odd numbers, then
$$
E(T) \geqslant 50-25=25.
$$

Notice that, the odd numbers in $S \backslash\left(P_{1} \cup P_{2} \cup P_{3}\right)$ are divided into
$$
\begin{array}{c}
Q_{1}=\left\{3,3^{2}, 3^{3}, 3^{4}, 5^{2}, 5 \times 7,5 \times 11,5 \times 13,\right. \\
\left.5 \times 17,5 \times 19,7^{2}, 7 \times 11,7 \times 13\right\}
\end{array}
$$

and
$$
\begin{aligned}
Q_{2}= & \left\{3 \times 5,3^{2} \times 5,3 \times 5^{2}, 3 \times 7,3^{2} \times 7,\right. \\
& 3 \times 11,3 \times 13,3 \times 17,3 \times 19,3 \times 23, \\
& 3 \times 29,3 \times 31\} .
\end{aligned}
$$

If $T$ contains $x \in Q_{1}$, then either
$$
f(x) \leqslant f(3) \leqslant\left[\frac{98}{2 \times 3}\right]=16,
$$

or
$$
f(x) \leqslant\left[\frac{98}{2 \times 5}\right]+\left[\frac{98}{2 \times 7}\right]=16,
$$

both are no greater than $E(T)-9$.
If $T$ does not contain elements from $Q_{1}$ but contains $x \in Q_{2}$, then $f(x) \leqslant\left[\frac{98}{2 \times 3}\right]+\left[\frac{98}{2 \times 5}\right]=25$.
Hence $E(T) \geqslant 25+13=38>f(x)+9$.
In summary, any 50-element subset $T$ of set $S$ contains 10 numbers that satisfy the condition.
Therefore, the minimum value of $n$ is 50.