I know how awful it is to hear them screaming in pain trying to do a poo... Your DD is still very young though, so i would be hesitant at this stage to try anything (e.g. the 'usual' remedies are offering water, diluted prune juice, coloxyl drops, warm water with a bit of brown sugar mixed in). But she is only 5 days old so I wouldn't want to be introducing anything other than milk into her system at this stage.

She might just have been crying from the sensation of having the poo moving through her bowels and then out, it must feel pretty horrible when you haven't had to do it before! Was her poo hard or runny-ish? If it's 'normal' poo I wouldn't be too worried yet, her digestive system is still probably working out how to function properly and digest the formula.

Oh..a warm bath and rubbing her tummy in a clockwise motion might help?