This is a useful tutorial by Alberto Cordero showing how to use an ID Map in substance painter:
How to use ID maps in Substance 3D Painter