Sean Eberhard has already answered your question in the comments, but perhaps it's worth mentioning that one can find quite precise information about the general class of problems you are interested in.
The key point is that the indicator function $n \mapsto 1_S(n)$ of sets defined in the way you propose are $1$-bounded multiplicative functions, and so one can use the myriad techniques in the literature to compute the mean values of such functions to get an upper bound (or even an asymptotic formula).
One approach is similar to the proof of the prime number theorem, where one relates the sum
$$\sum_{n\leqslant x} 1_S(n) $$
to the Dirichlet series
$$F(s) = \sum_{n=1}^\infty \frac{1_S(n)}{n^s} = \sum_{n \in S} \frac{1}{n^s}$$
by an application of Perron's formula, and then shifts the contour left. There will be a singularity at $s = 1$, which will determine your leading order behaviour. For your set $S$, one can check that there is an essential singularity of the type $(s-1)^{-1/2}$ at $s = 1$; this is basically because $S$ has density $1/2$ on the primes. This will give that
$$\sum_{n\leqslant x} 1_S(n) \asymp \frac{x}{(\log x)^{1/2}},$$
and indeed one can convert this into an asymptotic formula. This is exactly analogous to the work of Landau on the density of sums of two squares, except here one is working mod $3$ instead of mod $4$.
If $S'$ is the set you defined in the comments (i.e., for $n \in S'$ one has that $p \mid n$ implies $p \not\equiv -1 \bmod 12$), the density of $S$ on the primes is $3/4$, and so the essential singularity has type $(s-1)^{-3/4}$, and so
$$\sum_{n\leqslant x} 1_S(n) \asymp \frac{x}{(\log x)^{3/4}}.$$