Converse of a dimension lemma
I think the converse does not hold. Take $R=k[[x,y]]/(x^2, xy)$, where $k$ is a field, and mod out by $y$.
The answer to your question is the following: the equality holds iff $x$ is part of a system of parameters. Since in a Cohen-Macaulay ring systems of parameters are regular sequences (and viceversa), then you can easily deduce your answer.
$\textbf{}$