Constraining TeV-scale astrophysical foregrounds for dark matter searches with HAWC