In nonrelativistic mechanics, given a lagrangian $L$, we define the action as $$S[q]=\int L(q(t),\dot q(t))dt\tag{1}$$ and we can prove (see, for example, this answer for eq. (2)) $$\begin{align} \frac {\partial L} {\partial \dot q^i} &= \frac {\partial S} {\partial q^i} \tag{2} \\ \dot q^i \frac {\partial L} {\partial \dot q^i} -L&= -\frac {\partial S} {\partial t}\tag{3} \end{align} $$ so we call quantity (2) generalized momentum (covariant components) and quantity (3) energy of the particle.
In special relativity (signature $(+,-,-,-)$) the definition of 4-momentum I know from lesson is $$p_\mu = -\frac {\partial S} {\partial q^\mu}=\left (-\frac 1 c \frac {\partial S} {\partial t} , - \frac {\partial S} {\partial q^i}\right). \tag{4}$$
The spatial part of this 4-vector seems to be the opposite of the nonrelativistic generalized momentum, and this results in the equation $$p_\mu = \left (\frac E c, -p_i \right).\tag{5}$$ Both my professor and Landau-Lifshitz get rid of this extra minus sign, by saying that raising a spatial index changes sign, and covariant and contravariant components in nonrelativistic euclidean metric are equal, so we can write $$p^\mu = \left (\frac E c, p^i \right). \tag{6}$$
However, this reasoning seems flawed to me, because, in my understanding, the classical equations work with any metric, so they would work even with the metric $g_{ij} = -\delta_{ij}$, which is the one we use when we see $\mathbb R ^3$ as subspace of $\mathbb R ^{1,3}$. In other words, it seems to me that they are just arbitrarily exchanging the covariant and contravariant components of the vector. How can we make this more rigorous?
Clarifying the question by some comments I've made
It is clear that we want to achieve for the free particle $$p^\mu = mcu^\mu = \gamma m(c, v^i) = - \frac {\partial S} {\partial x_\mu}.\tag{7}$$
But in terms of the nonrelativistic momentum
$$p_{nr}^i = \frac {\partial S} {\partial x_i},\tag{8}$$ we have
$$p^\mu = (E,-p_{nr}^i).\tag{9}$$
So this means in the non relativistic limit $$p^i = mv^i = -p_{nr}^i,\tag{10}$$ but I thought $$p_{nr}^i = mv^i.\tag{11}$$ Where's my error?