  We present a study of $1347$ galaxies at $z<0.35$ with detected nuclear X-ray
emission and optical emission line diagnostics in the
Baldwin-Phillips-Terlevich (BPT) diagram. This sample was obtained by
cross-matching the X-ray Multi-Mirror Mission Observatory - Newton (XMM-Newton)
DR10 catalogue with Sloan Digital Sky Survey (SDSS) DR17 galaxies with
well-measured line ratios. The distribution of these sources in the BPT diagram
covers all three excitation regimes: Ionized Hydrogen (HII) regions (23\%),
`composites' (30\%), and Seyfert galaxies with the low ionization nuclear
emission line regions (LINERs) (47\%). In contrast, the fraction of objects
classified as active galactic nuclei (AGN) in the SDSS subsample selected for
cross-match with XMM-Newton is only 13\%. This fact illustrates that X-ray
emission from galaxies commonly points towards the presence of AGN. Our data
show, for the first time, a clear dependence of the BPT position on the ratio
of the X-ray to $H\alpha$ fluxes. Sources dominated by X-ray emission lie in
the Seyfert and LINER regimes of the BPT diagram. Most sources with a low
X-ray-to-$H\alpha$-luminosity ratio, $log_{10}(L_X/L_{H\alpha}) < 1.0$, lie in
the HII regime. In our sample, there are even 45 galaxies that have
$L^{Star}_{XR}/L^{Total}_{Xray}>0.5$. In contrast, the positions of the sample
members in the BPT diagram exhibit {no} dependence on the X-ray hardness ratio.
Our finding suggests that the X-ray-to-$H\alpha$ ratio can help us to
differentiate galaxies whose X-ray flux is dominated by an AGN {from galaxies
with} central X-ray binaries and other stellar X-ray sources.
