Let's denote the amount invested in the 5% account as x and the amount invested in the 8% account as 12000 - x.
The interest earned from the 5% account is given by 0.05x and the interest earned from the 8% account is given by 0.08(12000 - x).
We are given that the total interest earned is $840, so we can set up the equation:
0.05x + 0.08(12000 - x) = 840
Solving the equation gives:
0.05x + 960 - 0.08x = 840
-0.03x + 960 = 840
-0.03x = -120
x = 4000
So, Emilce invested $4000 in the 5% account and $8000 in the 8% account.
\textbf{Answer:} Emilce invested $4000 in the 5% account and $8000 in the 8% account.