What mesh format are you using? In Gmsh, if you export using INRIA Medit (.mesh) format, you should automatically get the correct labels (as set in Gmsh). See this post to verify the labels of your imported mesh.
1 Like