Depends.
You are asked for approximate concentration, thus your result of 5M should do.
But there is a small trick. If you dissolve 1 g of NaOH in 5mL of water final volume will be not 5mL but slightly more. Thus real concentration will be below 5M - about 4.94M (CASC rulez). Thats 1% change, so for all practical purposes it doesn't matter.