5. Let's define the equation of the process. Since the piston is light, the spring's elastic force at any moment is equal to the gas pressure force:

$$
k x=p(x) S
$$

where $x$ is the length of the cylinder occupied by the gas, which by condition is equal to the compression of the spring, $k$ is the spring stiffness coefficient, and $S$ is the base area of the cylinder. Multiplying both sides of the equation by $S$, we get

$$
p=\alpha V, \quad \alpha=\text { const. }
$$

Let's find the heat capacity of the gas in this process:

$$
c=\frac{d Q}{d T}
$$

Suppose the volume of the gas $V$ changes by a small amount $d V$. Then the pressure changes from $p$ to $d p=\alpha d V$, and the internal energy changes by

$$
d U=\frac{3}{2}((p+d p)(V+d V)-p V)=\frac{3}{2}(p d V+V d p)=3 \alpha V d V
$$

The temperature change will be $d T=\frac{2}{3} \frac{d U}{\nu R}=\frac{2 \alpha V d V}{\nu R}$.

The work done by the gas is $d A=p d V=\alpha V d V$.

The heat supplied to the system is

$$
d Q=d U+d A=4 \alpha V d V
$$

and the heat capacity is

$$
c=\frac{d Q}{d T}=2 \nu R
$$

To find the specific heat capacity, we need to divide the heat capacity of the entire gas by its mass $\nu \mu$, where $\mu$ is the molar mass of the gas.
Answer: $2 R / \mu=4155$ J $/($ kg $K)$.