You want it "...so the edges are black instead of white?" Getting depth on a flat image always involves a light direction with a light side and a shadow side. Looking again at your image, maybe a bevel will work. Applied twice from opposing directions to give a uniform effect.
This is using an old script gt-bevel299b.scm (attached) Unzip and put in your scripts folder C:\Users\"yourname"\AppData\Roaming\GIMP\2.10\scripts It registers in the Filters -> Decor menu. looks like this.
The procedure is:
Select the squares. You can use any method you like but the threshold'd black lines on white is a good option for a color select.
Switch to the pattern layer
Apply the gt-bevel script. Repeat the gt-bevel script with the light direction reversed.
If you keep the effect as a separate layer, it is possible to adjust, make it darker.
Again a quick demo
https://i.imgur.com/TDO08ek.mp4 50 seconds, do not blink.
There will be other ways. Keep looking in, maybe someone else will contribute.