Old paint smell.

Recently I used some old paint that was leftover from the house being built approximately 5 years ago. It had a moldy smell. Now the whole room has the smell. It is not a terrible smell and you cannot smell it outside the room. It is going to be a babies room once completed. Would repainting with new paint eliminate the smell? Don’t know how to proceed at this point.