Gravitational force acting between two point masses ml and m2 is given by the relation,
F = G m1m2/ r2
It does not depend upon the medium separating the two point masses. Therefore, gravitational force acting between two point masses will remain unaffected when they are dipped in water keeping the separation between them same. Only their apparent weights change, there is no effect on masses.