right. This is interesting. Dobby has some powerful magic, but Gollum is just crazy.
What it comes down to is this: A serial killer with some clothesline is one hundred times more dangerous than a cheerleader with a bazooka. (kudos to anyone who can tell me what author!).
Its all about the mental stance, not the abilities. So, if Dobby were as crazy bloodthirsty as Gollum, Gollum would be a smoking hole. But Dobby doesn't like hurting things, and Gollum enjoyed many long years of throttling orcs in the deep underground.
So Dobby would wimper, maybe knock Gollum around, but Gollum would tear out Dobby's throat with his teeth. Or fingers. Or even toes, if they were close.