If I understand correctly you are trying to apply your effect to images of particular galleries.
One way to target your gallery is the following.
[data-section-id="6138dc007192cb11bb8c2a7b"] .gallery-grid-item:hover {
opacity : 0.5;
}
This is for a v7.1 and specific to the posters need.
To find data section ids check out Heather Tovey's most excellent looking Squarespace ID Finder.
Let us know how it goes.