5. As shown in Figure 1, in $\triangle A B C$, it is given that $A B=A C$, $\angle A B C=40^{\circ}$, $B D$ is the angle bisector of $\angle A B C$, and $B D$ is extended to point $E$ such that $D E=A D$. Then the degree measure of $\angle E C A$ is ( ).
(A) $30^{\circ}$
(B) $40^{\circ}$
(C) $50^{\circ}$
(D) $60^{\circ}$
5. B.

Take a point $F$ on side $B C$ such that $B F=A B$. It is easy to prove that
$$
\triangle A B D \cong \triangle F B D, \triangle E C D \cong \triangle F C D .
$$