This might be all that you need to do, please test.
- Create a query template file. For this purpose it can be a dummy "template.html" with just one row with the magic string
<!-- MapServer Template -->
- Make the raster layer queryable by adding into MAP - LAYER
- By default no data is selected, add all data through adding into MAP - LAYER - METADATA
Now it should work with text/plain info_format. Test first by reading the GetCapabilities which must show for your raster layer
If that is the case you can test with QGIS by adding WMS layer, selecting the layer from Table of contents and by using the feature info tool. The info format must be text/plain. Text/html needs couple of further steps: a real template https://github.com/mapserver/mapserver/wiki/RasterQuery and adding a new info format into MAP - WEB: