Hi,
It's possible.
You have the "Display a contact button on the product page" in the HikaShop configuration to get that button.
You can have it displayed either for all the products all the time or on a per product basis.
And in that case, you'll get an option in each product in the backend to activate or not the display of the button.
You can then have a mass action run periodically to set the value of the product_contact column based on the value of the product_quantity field. That way you could activate the button when the product is out of stock.
And you could have a second mass action to turn that off.