Step 1: Set up the equation
Let \( x \) be the number subtracted. Then:
\[
\frac{87 - x}{223 - x} = \frac{5}{13}
\]
Step 2: Solve for \( x \)
Cross multiplying:
\[
(87 - x) \times 13 = (223 - x) \times 5
\]
\[
1131 - 13x = 1115 - 5x
\]
\[
16 = 8x
\]
\[
x = 6
\]
Thus, the correct answer is 6.