I am trying to derive Newton's second law from the principle of least action, that is, setting the functional derivative $\frac{\delta S}{\delta x(t)}$ equal to 0. $$S = \int dt' \left[ \frac{m}{2} \left( \frac{dx}{dt'} \right)^2 - V(x(t')) \right] \tag{1} $$ So, \begin{align} \frac{\delta S}{\delta x(t)} &= \int dt' \left[ \frac{m}{2} \frac{\delta}{\delta x(t)} \left( \frac{dx}{dt'} \right)^2 -\frac{\delta V(x(t'))}{\delta x(t)} \right] \tag{2} \\ &= \int dt' \left[ m \frac{dx}{dt'}\frac{d}{dt'}\delta(t-t') - \frac{\delta V(x(t'))}{\delta x(t')}\frac{\delta x(t')}{\delta x(t)} \right] \tag{3} \\ &= - \int dt' \left[ m \frac{d^2x}{dt'^2}\delta(t-t') + \frac{\delta V(x(t'))}{\delta x(t')} \delta (t-t') \right] \tag{4} \\ &= -\left[ m \frac{d^2x}{dt^2} + \color{Red}{\frac{\delta V(x(t))}{\delta x(t)}} \right]. \tag{5} \\ \end{align}
Now that I have calculated $(5)$, and then set the variation of the action equal to zero, I know that $\frac{\delta V(x(t))}{\delta x(t)}$ must be the same as $\frac{\partial V(x(t))}{\partial(x(t))}$ in order to reproduce Newton's second law. How does the functional derivative turn into the partial derivative in this case?
Note: to get the second term in $(3)$, I used chain rule, but for functional derivatives.