Step 1: Understand the arrangement of charges.
The charges are placed in the order
\[
+5q,\quad Q,\quad -2q
\]
The distance between \(+5q\) and \(Q\) is
\[
\frac{2r}{3}
\]
The distance between \(Q\) and \(-2q\) is
\[
\frac{r}{3}
\]
Therefore, the distance between \(+5q\) and \(-2q\) is
\[
\frac{2r}{3}+\frac{r}{3}=r
\]
Step 2: Force on \(-2q\) due to \(+5q\).
Since \(+5q\) and \(-2q\) are opposite charges, the force is attractive.
So, the force on \(-2q\) due to \(+5q\) is towards \(+5q\), that is, towards the left.
Magnitude of this force is
\[
F_1=\frac{k(5q)(2q)}{r^2}
\]
\[
F_1=\frac{10kq^2}{r^2}
\]
Step 3: Direction of force due to \(Q\).
For the net force on \(-2q\) to be zero, the force due to \(Q\) must be opposite to \(F_1\).
So, force due to \(Q\) on \(-2q\) must be towards the right.
Since \(Q\) is to the left of \(-2q\), this is possible only if \(Q\) is negative, so that \(Q\) and \(-2q\) repel each other.
Step 4: Force on \(-2q\) due to \(Q\).
Distance between \(Q\) and \(-2q\) is
\[
\frac{r}{3}
\]
Magnitude of force due to \(Q\) is
\[
F_2=\frac{k|Q|(2q)}{\left(\frac{r}{3}\right)^2}
\]
\[
F_2=\frac{2k|Q|q}{\frac{r^2}{9}}
\]
\[
F_2=\frac{18k|Q|q}{r^2}
\]
Step 5: Apply condition of zero net force.
For net force on \(-2q\) to be zero,
\[
F_1=F_2
\]
Thus,
\[
\frac{10kq^2}{r^2}
=
\frac{18k|Q|q}{r^2}
\]
Cancelling common terms,
\[
10q=18|Q|
\]
\[
|Q|=\frac{10q}{18}
\]
\[
|Q|=\frac{5q}{9}
\]
Since \(Q\) must be negative,
\[
Q=-\frac{5q}{9}
\]
Step 6: Final conclusion.
Therefore,
\[
\boxed{Q=-\frac{5q}{9}}
\]