5. Let the set
$$
S=\{1,2, \cdots, 12\}, A=\left\{a_{1}, a_{2}, a_{3}\right\}
$$

satisfy $a_{1}<a_{2}<a_{3}, a_{3}-a_{2} \leqslant 5, A \subseteq S$. Then the number of sets $A$ that satisfy the conditions is
5. 185 .

Notice that, the number of all three-element subsets of set $S$ is
$$
\mathrm{C}_{12}^{3}=220 \text {. }
$$

The number of subsets satisfying $1 \leqslant a_{1}<a_{2}<a_{3}-5 \leqslant 7$ is $\mathrm{C}_{7}^{3}=35$, so the number of sets $A$ that meet the conditions of the problem is $220-35=185$.