An equivalent of subdirect irreducibility for semigroups

Let $S$ be a semigroup. Prove that $S$ is a subdirect product of the family of semigroups $\{S_a\}_A$ indexed by $A$ if and only if for every $a \in A$, there is a surjective semigroup homomorphism $\varphi_a : S \rightarrow S_a$ such that the family of induced congruences (that is, the kernels of the $\varphi_a$) separate the elements of $S$.

First, suppose $\psi : S \rightarrow \prod_A S_a$ is a subdirect product; then by definition the composites $\varphi_a = \pi_a \circ \psi : S \rightarrow S_a$ are surjective semigroup homomorphisms. The family of kernels of the $\varphi_a$ separate the elements of $S$ by Proposition II.1.4.

Conversely, if we have such a family of homomorphisms, then by Proposition II.1.4, $S$ is a subdirect product of the family $\{S/\mathsf{ker}\ \varphi_a\}_A$. By the First Isomorphism Theorem for semigroups (proved here), $S/\mathsf{ker}\ \varphi_a \cong S_a$, so that $S$ is a subdirect product of the $S_a$.