If one has a homomorphism of two rings $R, S$, and $R~$ has an identity, then the identity must be mapped to an idempotent element of $S$, because the equation $x^2=x$ is preserved under homomorphisms. Now $5$ is not an idempotent element in $\Bbb Z_{15}$, so the map generated by $1 \to 5$ is not a homomorphism.
However, $10$ is an idempotent element of $\Bbb Z_{15}$. In particular, the subring $T \subset \Bbb Z_{15}$ generated by $10$ has unit $10$. Since it is annihilated by $3$, and consequently by $18$, there is a unital homomorphism $\Bbb Z_{18} \to T$ (i.e., mapping $1$ to $10$). So your second map is a legitimate homomorphism of rings (composing with the injection $T \to \Bbb Z_{15}$).
Basically, the point of this answer is to check that one of your maps preserves the relations of the two rings, while the other doesn't.