Can a volume be set to let through index pass values?
The most not intrusive method (that will allow You achieve the effect without many changes) would be to duplicate the object, that material pass You're using, put it to another layer, create Render layer for it (only that layer would be rendered, (if it's in Cycles also with other layers selected as Excluded) Check only Material Pass for this layer and uncheck all others, and Use the material index rendered this way in the compositor.