A module $M$ is a maximal Cohen-Macaulay module over the ring $R$ if $\depth M = \dim R$, where $\dim R$ denotes the Krull dimension of $R$. I've been told that if $R$ is a Gorenstein local ring, then $M$ is a maximal Cohen-Macaulay module if and only if $\Ext^i(M,R)=0$ for all $i \geq 1$. (This is taken as the definition here.)
How can this be proved? And does anyone have a source where this has been proved? Is it true for Gorenstein local rings only, or also for Gorenstein (not necessarily local) rings too?
I primarily work with commutative rings and finitely generated modules.