Martha Stewart needed 9 stitches to close up a bloody gash on her upper lip this week after her dog accidentally headbutted the domestic goddess in the face.

Martha was getting ready to leave her NY home Tuesday when she leaned over to "whisper goodbye" to her dozing french bulldog, Francesca. But Martha says she must have "startled" the dog, because Franny shot upwards and hit Martha in the face ... busting her lip open.

Martha says she "felt a bit of whiplash as blood gushed forth from [her] split lip."

Unable to stop the bleeding herself, Martha first called police to ask for a ride ... before remembering that she had a driver on standby.

Martha eventually made it to the emergency room -- where she was promptly sewn back up.