jQuery#closest() will return the current element, if it matches the selector. So you can either use jQuery#parents() like suggested by @Frederic, or manually go up one element:
$(this).closest('div').parent().closest('div').attr('id');
That said, you had another problem in your code. You wrapped the two closest() calls in parentheses. This would have the effect of those two calls being evaluated before the others. Since you probably don't have a function called closest in your scope, the given code would've failed with a ReferenceError.
(I'm only providing this as an explanation to why your initial code failed, you should really go with @Frederic's suggestion)