Divide the input speed by the ratio to get output speed - 1000 rpm into a 5:1 gear set will have 200 rpm output.
Multiply the torque, but include a factor for efficiency - 5 Nm in to a 5:1 ratio would give 25 Nm output torque, assuming 100% efficiency. Depending on the gearbox, gear type etc, you might be looking at anything between 60% and 98% efficiency for example.
5Nm through 5:1 with 85% efficiency = 5 x 5 x 0.85 = 21.25 Nm.
In practice, efficiency will likely vary with speed.