You can do it with (uses --installed):

brew uses --installed gmp

Well, I know it for quite some time, but for some reason I forget the command every time.