Are you sure on the part number? That looks to be an EPCS4 device, not EPC4. There were never any EPC* devices with only 8 pins, unless I'm mistaken.
If it is EPCS4, then it is a bog-standard SPI flash. The M25P40 is a direct dropin replacement. Also, more recently the W25X40CLSNIG can be used as a dropin, though its silicon ID may not allow for Quartus to program it through the IDE.
In any case, that could be a JTAG or a AS programming header. You can try flipping it backwards, the pinout is safe and it won't blow up.
In case it is JTAG, you will have the option to create a Serial Flash Loader chain which basically programs the FPGA with a stub bitstream that wiggles and programs the flash for you, directly from Quartus.
JTAG is always available, if connected, no matter what configuration mode is specified on the FPGA's MSEL strapping pins. So if you have managed to power the probe, and tried Jtagging with both cable orientations with a known working USB Blaster, then it may not be a JTAG header. (Make sure you test your blaster on something else first)
In case it is AS, the header will directly connect to the SPI flash. You could beep out the connections to check this.