Step 1: Define the events and variables.
Let $B_1$ be the event of choosing the first box, and $B_2$ be the event of choosing the second box. Since a box is chosen at random:
\[
P(B_1) = P(B_2) = \frac{1}{2}.
\]
Let $E$ be the event that a black ball is drawn.
Let $n_1$ and $n_2$ be the number of black balls in the first and second boxes, respectively. Each box contains a total of 10 balls.
The conditional probabilities are:
\[
P(E|B_1) = \frac{n_1}{10}, P(E|B_2) = \frac{n_2}{10}.
\]
Step 2: Apply Bayes' Theorem.
We are given:
\[
P(B_2|E) = \frac{1}{5}.
\]
Bayes' Theorem states:
\[
P(B_2|E) = \frac{P(B_2)P(E|B_2)}{P(B_1)P(E|B_1) + P(B_2)P(E|B_2)}.
\]
Step 3: Substitute the known values.
\[
\frac{1}{5} = \frac{(1/2)(n_2/10)}{(1/2)(n_1/10) + (1/2)(n_2/10)}.
\]
Cancelling the common factors $(1/2)$ and $(1/10)$:
\[
\frac{1}{5} = \frac{n_2}{n_1 + n_2}.
\]
Step 4: Solve for the relationship between $n_1$ and $n_2$.
\[
n_1 + n_2 = 5 n_2 \implies n_1 = 4 n_2.
\]
Step 5: Determine possible integer values.
Since $n_1, n_2$ are integers between 1 and 10:
- If $n_2 = 1$, then $n_1 = 4 \cdot 1 = 4$ (valid).
- If $n_2 = 2$, then $n_1 = 4 \cdot 2 = 8$ (valid).
- If $n_2 = 3$, then $n_1 = 4 \cdot 3 = 12$ (invalid, exceeds 10).
Hence, the possible number of black balls in the first box is:
\[
\boxed{4 \text{ or } 8}.
\]