Trying to set transparency on the viewer Node
You don't need an ID mask, just use a transparent background for your scene and then composite using alpha over.

Enable film transparent,



Then use alpha over to combine the rendered image with the background:



The transparency from the glass should work fine.