I was thinking about this for some time and I wanted to clarify my question. Can the Euler-Lagrange equation be somehow derived from Newton's second law? Here's a possible way to do it: We start with Newton's second law for a non-relativistic point particle of mass $m$ under a conservative force, $m \frac{\mathrm{d}^2 \vec{r}}{\mathrm{d} t^2}=-\nabla U$. Converting this to index notation and choosing a Cartesian coordinate system, we have $$m \frac{\mathrm{d}^2 x^i}{\mathrm{d} t^2}=-\frac{\partial U}{\partial x_i}=\frac{\mathrm{d} p^i}{\mathrm{d} t},$$ where $i \in \{1,2,3\}$ and $p^i=m\dot{x}^i$.
Now define the quantity $T=\frac{1}{2}m\dot{x}^j\dot{x}_j$ (kinetic energy), and Einstein summation convention is used here. It is easy to see that $$p^i=\frac{\partial T}{\partial \dot{x}_i}=m\dot{x}^i.$$ Substituting this result into Newton's second law we obtain the relation $$\frac{\mathrm{d}}{\mathrm{d} t} \frac{\partial T}{\partial \dot{x}^i}=-\frac{\partial U}{\partial x^i}.$$ Now, defining the function $L=T-U$, and since $\frac{\partial U}{\partial \dot{x}^i}=0$ and $\frac{\partial T}{\partial x^i}=0$, we arrive at the celebrated equation $$\frac{\mathrm{d}}{\mathrm{d} t} \frac{\partial L}{\partial \dot{x}^i}=\frac{\partial L}{\partial x^i}.$$
Now, is this derivation valid? Can it be shown from this to be valid for all holonomic systems?