Objects shows through other objects when compositing
My example was made in Blender Render, but it doesn't matter in this case.
First of all enable Object Index pass in Render Passes tab, then give index 1 to your hose (note, that objects with same index will produce combined mask, and to keep them separate use different numbers).

Edit: Material index pass is usefull when your object can't be physically separated in parts, so apply different materials for these parts.

This is overall setup: