Density is mass divided by volume. The mass of the block is 10 grams. The volume of the block is 2 mL: the water changes from the 3 mL line to the 5 mL when the block is added, so the block must be 5-3= 2 mL.
So, the density is 10 g / 2 mL = 5 g/mL.
Hope this helps!