# Mathematica, 33 bytes

    (P=PrimeQ;P@#&&(P[#+2]||P[#-2]))&

<a href="https://tio.run/##y00sychMLv6fZvtfI8A2oCgzNzXQOsBBWU1NIyBaWdsotqYGSOsaxWpqqv0HSueV6Duk6TtUG@somOoomOsoGBoCMZBnCGJb6igYAbExUMwEhI1ruZD0GAFVADUZGQAxUIcxUIcJEFuCdIIETc3Mav8DAA" title="Mathics – Try It Online">Try it online!</a>