The labels are probably defined in the MXD that was used to publish the data so, more than likely, they were never actually part of the dataset's attributes.
Anyways, I suppose you could retrieve a copy of the layer's legend in JSON format using the REST API:
http://geodata.md.gov/imap/rest/services/Biota/MD_BenthicHabitat/MapServer/legend?f=json
JS code wise, something like this:
var url = "http://geodata.md.gov/imap/rest/services/Biota/MD_BenthicHabitat/MapServer/legend?f=json";
var requestHandle = esriRequest({
url: url,
content: {
f: 'json'
},
handleAs: "json"
});
requestHandle.then(
function (theJSON, io) {
//no problems encountered. Process content stored in theJSON..
}, function (err) {
//Error encountered while retrieving the JSON version of the legend..
}
};
The above would need AMD references for "dojo/_base/json", "esri/urlUtils", and "esri/request"
What you could do is step through the legend information and maybe build an array of code/labels. When your user clicks on a feature, use an infoWindow setContent function to look up the matching label and present whatever information you want to your users.