Has any one else gotten anywhere with this? I've tried a few things none of which got me anywhere.
The first method I tried was to brute force it like any other Laplace problem. I wasn't able to get very far apart from applying the left most boundary condition because after that I didn't have functions I could readily work with.
The second method I tried separating the problem into two different problems that shared $f(x)$ as a boundary condition.
I separated the larger rectangle into two separate ones, one for $x\leq4$ and one for $x>4$. I then had two different Dirichlet problems both with a shared boundary condition. I then defined the solution to the right domain to be $w(x,y)=u(x,y)+2$ which made the boundary conditions $0$ except for the shared boundary. Rewritten as two different Dirichlet problems I had
$$
\begin{aligned}
u(x,&y)\\
u(x,0)&=0\\
u(x,5)&=0\\
u(0,y)&=0\\
u(4,y)&=f(x)
\end{aligned}
\,\,\,\,\,\,\,\,\,\,\,\,
\begin{aligned}
w(x,y)=u&(x,y)+2\\
w(x,0)&=0\\
w(x,5)&=0\\
w(8,y)&=0\\
w(4,y)&=f(x)+2
\end{aligned}
$$
When I tried though it didn't work because I got $\lambda=0$.
The third thing I tried was to utilize $u(x,y)=u(x,5-y)$ that is that the solution should be symmetric about $y=5/2$ again though I ran into stuff that I couldn't see a way to immediately work with.