This kind of question has been asked before, but for a UFD. I want to show the result, more generally, for an integral domain.
Let $R$ be an integral domain (not necessarily a UFD).
Suppose $a, b \in R$ with $d \mid a,\;d \mid b \implies d$ unit.
Show that
$a \mid c,\; b \mid c \implies ab \mid c$
EDIT: Or find a counterexample. Turns out the result is not true, in general!
This is not true in all domains since it implies atoms (irreducibles) $\,p\,$ are prime, i.e.
$$p\mid ab,\ p\nmid a\,\Rightarrow\, (a,p)=1,\ \ {\rm so}\,\ \ a,p\mid ab\,\Rightarrow\, ap\mid ab\,\Rightarrow\, p\mid b$$
So any non-UFD number ring yields a counterexample, e.g. see here for that and more.