The mass of the object does not change. The mass at sea level is the same mass on the spaceship.
Force , F = mg. Where m is mass in kg, and g is acceleration due to gravity in ms², and F is the weight in Newtons.
5.10 = m*9.81
5.1/9.81 = m
mass = (5.1/9.81) kg.
At the spaceship: F = mg, g here is the gravity on the spaceship, and the mass is the same as on the earth.
3.81 = (5.1/9.81)*g
(5.1/9.81)*g = 3.81
g = 3.81 * 9.81/5.1
g ≈7.33
Therefore gravity on the object in the spaceship ≈ 7.33 m/s²