Comparing parts of patterns by name

Let’s say I wanted to pick out all the rows of a table for which columns 3 and 5 are equal. The following doesn’t work, as the second x is treated as an independent variable.

Cases[table, {_, _, x_, _, x, ___}] 

How do I make sure x is recognized "outside itself", so to speak?