Warning: This script is experimental and you're not able to Ctrl-Z to undo the process of the script.
Let's say you have a depth map (gray scale) layer with brightest value at (50,50,50).
And you have another depth map layer with brightest value at (200,200,200).
And you have a third layer of a hand painted depth map layer of intricate pattern/design with brightest values at (255,255,255) and darkest value at (0,0,0).
like this diagram
And you want to stretch the height map of your hand painted intricate pattern so that the darkest value matches the brightest value of the first layer and the brightest value matches the brightest value of the second layer.
like this diagram (so that all three layers together gives you a nice height map)
Just make a selection and enter 200 for New Bright Value and enter 50 for New Dark Value.
Script will available under
Python-Fu/Height Stretch Selection...