Hello,
Title Overlay on the Gallery Image is already a built-in feature and you can consider using the following Code:
<a href="images/blocks/preview/gallery-5/1.jpg" title="Image">
<img src="images/blocks/preview/gallery-5/1.jpg" alt="Image" />
<div class="bg-overlay">
<div class="bg-overlay-content justify-content-start align-items-end">
<span class="bg-white px-3 py-2 rounded text-dark fw-bold">Aluminum</span>
</div>
</div>
</a>
However, the Caption inside the Lightbox needs to be manually designed according to your needs. You will need to add Custom Code for the .mfp-bottom-bar and .mfp-title CSS Blocks in the css/custom.css File.
Hope this Helps!
Let us know if we can help you with anything else or if you find any further issues.