(Edited to reflect your edit to the question!)
The answer to your original statement (without the "nonempty" assumption) is no because we can let $A=\varnothing$ and $B=\ast$. Their endofunctor categories are each discrete with one object, but the categories themselves are not equivalent.
The question becomes a lot trickier when you add "nonempty" to the statement, but I think the answer is still no. I believe the following is a counterexample:
Let $G$ be an abelian group such that $G\times G\cong G$ and $\text{End}(G,G)$$\text{End}(G)$ is infinite. (So, for example, let $G=\Pi_{n\geq 1} \mathbb{Z}$). Let $C$ be the one object category corresponding to $G$. Notice that $C$ is not equivalent to $C\sqcup C$ because $C$ has just one object and $C\sqcup C$ has two non-isomorphic objects. But let's compare their endofunctor categories.
First, let's describe $C^C$. The objects in $C^C$ are precisely the homomorphisms $G\rightarrow G$. Each morphism in $C^C$, i.e., each natural transformation $\phi\Rightarrow \psi$, is a choice of $g\in G$ such that $g\phi(h)=\psi(h)g$ for all $h$, but since $G$ is abelian, that means $\phi=\psi$. Thus, $C^C\cong \sqcup_{\text{End}(G,G)} C$$C^C\cong \sqcup_{\text{End}(G)} C$. Now, observe that $(C\sqcup C)^C\cong C^C \sqcup C^C$ since $C$ has one object. Putting these together and using the fact that $C^{(-)}$ sends colimits to limits, we have
$(C\sqcup C)^{C\sqcup C}\cong (C\sqcup C)^C\times (C\sqcup C)^C \cong (C^C \sqcup C^C)\times (C^C\sqcup C^C)\cong C^C \times C^C$,
where the last isomorphism comes from $C^C$ being an infinite coproduct. But then
$C^C\times C^C \cong (\sqcup_{\text{End}(G,G)} C) \times (\sqcup_{\text{End}(G,G)} C)\cong \sqcup_{\text{End}(G,G)\times \text{End}(G,G)} (C\times C)\cong \sqcup_{\text{End}(G,G)} C\cong C^C$$C^C\times C^C \cong (\sqcup_{\text{End}(G)} C) \times (\sqcup_{\text{End}(G)} C)\cong \sqcup_{\text{End}(G)\times \text{End}(G)} (C\times C)\cong \sqcup_{\text{End}(G)} C\cong C^C$
(Note: In this example, the endofunctor categories are in fact isomorphic, not just equivalent.)