Arising from a topological twist of $mathcal{N} = 4$ super Yang-Mills theory are the Kapustin-Witten equations, a family of gauge-theoretic equations on a four-manifold parametrized by $tinmathbb{P}^1$. The parameter corresponds to a linear combination of two super charges in the twist. When $t=0$ and the four-manifold is a compact Kahler surface, the equations become the Simpson equations, which was originally studied by Hitchin on a compact Riemann surface, as demonstrated independently in works of Nakajima and the third-named author. At the same time, there is a notion of $lambda$-connection in the nonabelian Hodge theory of Donaldson-Corlette-Hitchin-Simpson in which $lambda$ is also valued in $mathbb{P}^1$. Varying $lambda$ interpolates between the moduli space of semistable Higgs sheaves with vanishing Chern classes on a smooth projective variety (at $lambda=0$) and the moduli space of semisimple local systems on the same variety (at $lambda=1$) in the twistor space. In this article, we utilise the correspondence furnished by nonabelian Hodge theory to describe a relation between the moduli spaces of solutions to the equations by Kapustin and Witten at $t=0$ and $t in mathbb{R} setminus { 0 }$ on a smooth, compact Kahler surface. We then provide supporting evidence for a more general form of this relation on a smooth, closed four-manifold by computing its expected dimension of the moduli space for each of $t=0$ and $t in mathbb{R} setminus { 0 }$.