By "ring," let us mean a not-necessarily unital ring.
Then $2\mathbb{Z}_6 = \{0,2,4\} \subseteq \mathbb{Z}_6$ and $2\mathbb{Z}_8 = \{0,2,4,6\} \subseteq \mathbb{Z}_8$ are both rings under the induced operations. The former happens to possess a multiplicative identity, namely $4$. The latter does not.
Question. For which natural numbers $n,k > 1$ does the ring $n\mathbb{Z}_k$ happen to possess a multiplicative identity?
$n\mathbb{Z}_k$ has a multiplicative identity if and only if there is an $a\in \{1,\dotsc,k-1\}$ (we exclude the case $k = 1$ here) such that for all $0 \leqslant b < k$ we have
$$(na)(nb) \equiv nb \pmod{k}.\tag{$\ast$}$$
Write $(\ast)$ in the form $(na-1)(nb) \equiv 0 \pmod{k}$. Setting $b = 1$, we see that the necessary and sufficient condition is the existence of an $a$ with
$$(na-1)n \equiv 0 \pmod{k}.\tag{$\ast\!\ast$}$$
Let $g = \gcd(n,k)$, and write $n = \nu g,\; k = \kappa g$. Then $(\ast\ast)$ becomes
$$(n a-1)\nu \equiv 0 \pmod{\kappa}.\tag{$\ast\!\ast\!\ast$}$$
Since $\gcd(\nu,\kappa) = 1$, that is equivalent to
$$na \equiv 1 \pmod{\kappa},$$
so we find that $n\mathbb{Z}_k$ has a multiplicative identity if and only if
$$\gcd\left(n, \frac{k}{\gcd(n,k)}\right) = 1.$$