If a C*-algebra $A=\overline{\bigcup S}$, where $S$ is a class of prime C*-subalgebras, then $A$ is prime. This is question 5.6 of Murphy's C$^*$-Algebras and Operator Theory:

Let $S$ be a set of C*-subalgebras of a C*-algebra $A$ that is upwards-directed, that is, if $B,C\in S$, then there exists $D\in S$ such that $B,C\subseteq D$. Show that $\overline{(\bigcup S)}$ is a C*-subalgebra of $A$.
  Suppose that all the algebras in $S$ are prime and that $A=\overline{\bigcup S}$. Show that $A$ is prime.

A C$^*$-algebra $A$ is prime if any of the following equivalent conditions is satisfied:


*

*For any closed ideals $I,J\subseteq A$, $IJ=0$ implies $I$ or $J=0$.

*The intersection of any two nonzero closed ideals in $A$ is nonzero.

*For any $a,b\in A$, $aAb=0$ implies $a$ or $b=0$.

*For any nonzero closed ideal $I$ of $A$, the "annihilator" $I^\perp=\left\{x\in A:\forall i\in I, xi=0\right\}$ is zero.


(In item 1, $IJ$ is the closure of $span\left\{ij:i\in I, j\in J\right\}$, and in fact $IJ=I\cap J$.)
What I've done: The first part (that $\overline{(\bigcup S)}$ is a C*-algebra) is easy enough, and I'm struggling with the second one.
If the elements of $S$ were ideals I would be able to solve it (using condition 3.): if $aAb=0$ with $a\neq 0$, we can take an approximate unit in $\bigcup S$ and obtain $I\in S$ and $u\in I$ with $au\simeq a$ and $ub\simeq b$. Then $(au)I(ub)=0$, and primeness of $I$ implies $b\simeq ub=0$, since $au\simeq a\neq 0$ (the "approximate equalities" $\simeq$ mean an $\epsilon$-argument).
But since the elements of $S$ are simply subalgebras I don't know what to do. The best I can think of is the following: Suppose $aAb=0$ with $a,b\neq 0$, and let's seek a contradiction. We approximate $a$ and $b$ by elements $a'$ and $b'$ (with same norm, say) of some $B\in S$, but there is no reason that $a'Bb'=0$ (which would solve our problem, just as above).
 A: Here is an argument for the last part. 
Assuming we already know that  $I=\overline{\bigcup_{B}B\cap I}$:
If $I,J$ are ideals in $A$ and $IJ=0$, then for any $B\in S$ we have $0=B\cap IJ=(B\cap I)(B\cap J)$. As $B$ is prime, $B\cap I=0$ or $B\cap J=0$. Suppose $B_1\cap I\ne0$, and $B_2\cap J\ne0$, with $B_1\subset B_2$; then $B_2\cap I\supseteq B_1\cap I\ne0$, which would imply that $B_2\cap J=0$. This shows that no such pair can exist, i.e. either $B\cap I=0$ for all $B$, or $B\cap J=0$ for all $B$. In the first case, 
$$
I=\overline{\bigcup_BB\cap I}=0,
$$
while in the second one $J=0$. So $A$ is prime. 
A: Our main problem is that, in principle, we cannot just "map the question" to the elements of $S$ by taking intersections. To solve this, we can use an argument similar to the one on the proof of Theorem 6.2.6 of the same book (and I will even use the same notation).
Given an ideal $I$ of $A$, let $J=\overline{\left(\bigcup_{B\in S}B\cap I\right)}$. Then $J$ is a closed ideal in $A$ contained in $I$. We will show that $J=I$ by showing that the well-defined $*$-homomorphism $\varphi:A/J\to A/I$, $\varphi(a+J)=a+I$, is an isometry.
Note that $A/J=\overline{\left(\bigcup_{B\in S}(B+J)/J\right)}$, so it suffices to show that $\varphi$ is isometric in each sub-C*-algebra $(B+J)/J$ for $B\in S$. Let $\psi:(B+J)/J\to B/(B\cap J)=B/(B\cap I)$ and $\theta:(B+I)/I\to B/(B\cap I)$ denote the canonical $*$-isomorphisms, and $i:(B+I)/I\to A/I$ be the inclusion. Then $\varphi$ is equal to $i\theta^{-1}\psi$ in $(B+J)/J$, a composition of isometric homomorphisms, hence isometric itself.
Thus, we've shown that $I=\overline{\left(\bigcup_{B\in S}B\cap I\right)}$ for every ideal $I$ in $A$.
Now let $I$ be a nonzero ideal of $A$. Since $I=\overline{\left(\bigcup_{B\in S}B\cap I\right)}$, then $I\cap B$ is nonzero for every $B\in S$ sufficiently large. Since $B$ is prime, the annihilator of $B\cap I$ inside $B$ is zero, i.e., $(B\cap I)^{\perp,B}=B\cap I^\perp=0$. Since $I^\perp$ is also an ideal of $A$, we also obtain $I^\perp=\overline{\left(\bigcup_{B\in S}B\cap I^\perp\right)}=0$. This proves that $A$ is prime.
