You're looking at a 3rd order polynomial that goes generally down.
It has a duplicate root at x=-4, meaning it has an extreme there.
To have exactly 2 solutions for f(x)=5, it needs to have another extreme at some x where f(x)=5.
Perhaps you can take the derivative of f and equate it to 0?
You should find x=-4 as a solution, and some other x that depends on a.
For that value of x, you should have f(x)=5.
And you are correct that there is a bit of algebra involved in solving this system. To be honest, when I first saw this problem, I felt that applying the remainder theorem would most likely be the way to go.