Let's consider a more general case. Let $a$ be a vector in $\mathbb R^m$. You basically want,
$$a \cdot \nabla_\lambda [Y-\underline X(\lambda)]^2$$
where $\nabla_\lambda$ is a differential operator corresponding to derivatives with respect to $\lambda$. The chain rule tells that this is equal to
$$(a \cdot \nabla_\lambda [Y-\underline X(\lambda)] )\cdot \nabla_{Y-\underline X(\lambda)} [Y-\underline X(\lambda)]^2$$
To evaluate this, you just need a couple results about directional derivatives. First, $a \cdot \nabla_x \underline T(x) = \underline T(a)$ for any vectors $a, x$ and linear operator $\underline T$. Second, $a \cdot \nabla_x x^2 = 2a\cdot x$. With all this in mind, the expression reduces to
$$-\underline X(a) \cdot 2[Y-\underline X(\lambda)] = -2a \cdot \overline X[Y-\underline X(\lambda)]$$
To pick out a particular $\lambda_j$, simply pick $a$ such that it is full of zero entries save for a 1 in the right place.
All this follows from the chain rule and a couple basic identities for vector derivatives. Edit: Overall, it's easier (in my opinion) to consider matrix operations abstractly as linear maps instead of as matrices proper. This is basically what I've done here. Multiplication of matrices just becomes composition of functions, and that's something we know how to attack via the chain rule.