It will work that way if all the image links have the same data rel attribute, for example data-rel=”lightbox-gallery-1″.
Easiest way would be to check the data rel parameter of the gallery (added automatically on the frontend), then use the same data rel for the single image links (by adding that manually in the backend or in the theme – depending on how you’re trying to achieve that)