  The JWST NIRSpec integral field unit (IFU) presents a unique opportunity to
observe directly imaged exoplanets from 3-5 um at moderate spectral resolution
(R~2,700) and thereby better constrain the composition, disequilibrium
chemistry, and cloud properties of their atmospheres. In this work, we present
the first NIRSpec IFU high-contrast observations of a substellar companion that
requires starlight suppression techniques. We develop specific data reduction
strategies to study faint companions around bright stars, and assess the
performance of NIRSpec at high contrast. First, we demonstrate an approach to
forward model the companion signal and the starlight directly in the detector
images, which mitigates the effects of NIRSpec's spatial undersampling. We
demonstrate a sensitivity to planets that are 3e-6 fainter than their stars at
1'', or 3e-5 at 0.3''. Then, we implement a reference star point spread
function (PSF) subtraction and a spectral extraction that does not require
spatially and spectrally regularly sampled spectral cubes. This allows us to
extract a moderate resolution (R~2,700) spectrum of the faint T-dwarf companion
HD 19467 B from 2.9-5.2 um with signal-to-noise ratio (S/N)~10 per resolution
element. Across this wavelength range, HD~19467~B has a flux ratio varying
between 1e-5-1e-4 and a separation relative to its star of 1.6''. A companion
paper by Hoch et al. more deeply analyzes the atmospheric properties of this
companion based on the extracted spectrum. Using the methods developed here,
NIRSpec's sensitivity may enable direct detection and spectral characterization
of relatively old (~1 Gyr), cool (~250 K), and closely separated (~3-5 au)
exoplanets that are less massive than Jupiter.
