You won’t be able to achieve such a result with a transparent stroke. A stroke may be transparent but won’t hide anything below itself
I can see 2 ways of doing this :
Use a stroke, set it to “outside” and manually pic its color so it’s the same as the one in your background
Use a subtract selection so you can remove the “stroke” from the rectangle below:
a. Add a stroke to the top rectangle, then disconnect it (cmd+shift+O or ctrl+shift+O)
b. make sure the stroke is above your rectangle
c. select them (rectangle and stroke) and use a subtract union