Note that from a common theorem we have that

$\displaystyle \begin{aligned}\dim\left(U+W\right) &=\dim\left(U\right)+\dim\left(W\right)-\dim\left(U\cap W\right)\\ &=(n-1)+(n-1)+\dim\left(U\cap W\right)\\ &=2n-2+\dim\left(U\cap V\right)\end{aligned}\quad\quad\mathbf{(1)}$

Note though that since $\displaystyle U+W\leqslant V$ we must have that $\displaystyle \dim\left(U+W\right)\leqslant n$ and so by $\displaystyle \mathbf{(1)}$ we know that $\displaystyle \dim\left(U\cap W\right)\geqslant n-2$. But, since $\displaystyle U\cap W\leqslant U$ we know that $\displaystyle \dim\left(U\cap W\right)\leqslant n-1$. Thus, putting these two together gives

$\displaystyle n-2\leqslant\dim\left(U\cap W\right)\leqslant n-1$

Thus, $\displaystyle \dim\left(U\cap W\right)$ equals either $\displaystyle n-2$ or $\displaystyle n-1$. And so plugging this into $\displaystyle \mathbf{(1)}$ gives

$\displaystyle \displaysytle \dim\left(U+W\right)\begin{cases}n & \mbox{if}\quad \dim\left(U\cap W\right)\ne n-1\\ n-1 & \mbox{if}\quad \dim\left(U\cap W\right)=n-1\end{cases}$

But note that $\displaystyle \dim\left(U\cap V\right)\ne n-1\implies U\cap V\ne U\implies U\ne V$ and $\displaystyle \dim\left(U\cap V\right)=n-1\implies U=V$ (the first is clear, and the second follows since $\displaystyle U\cap V\leqslant U$ and a subspace which has the same dimension as the ambient space must be the full space). Thus, this may be rewritten as

$\displaystyle \dim\left(U+W\right)=\begin{cases}n & \mbox{if}\quad U\ne W\\ n-1 & \mbox{if}\quad U=W\end{cases}$

Thus, if $\displaystyle U\ne W$ then $\displaystyle U+W$ is an $\displaystyle n$-dimensional subspace of $\displaystyle V$ and thus equal to $\displaystyle V$ and if $\displaystyle U=V$ then $\displaystyle U+W$ is an $\displaystyle n-1$-dimensional subspace and not equal to $\displaystyle V$. The conclusion follows.