Sortase A (SrtA) is a cysteine transpeptidase that binds to the periplasmic membrane and plays a crucial role in attaching surface proteins, including staphylococcal protein A (SpA), to the peptidoglycan cell wall. Six pentacyclic polyketides (1-6) were isolated from the marine sponge Xestospongia sp., and their structures were elucidated using spectroscopic techniques and by comparing them to previously reported data. Among them, halenaquinol (2) was found to be the most potent SrtA inhibitor, with an IC50 of 13.94 μM (4.66 μg/mL). Semi-quantitative reverse transcription PCR data suggest that halenaquinol does not inhibit the transcription of srtA and spA, while Western blot analysis and immunofluorescence microscopy images suggest that it blocks the cell wall surface anchoring of SpA by inhibiting the activity of SrtA. The onset and magnitude of the inhibition of SpA anchoring on the cell wall surface in S. aureus that has been treated with halenaquinol at a value 8× that of the IC50 of SrtA are comparable to those for an srtA-deletion mutant. These findings contribute to the understanding of the mechanism by which marine-derived pentacyclic polyketides inhibit SrtA, highlighting their potential as anti-infective agents targeting S. aureus virulence.