Not reliably, i.e. 100% correct all the time, but we can make a good guess.
The resources set by the GNOME settings manager are quite specific (like
Emacs.scroll-bar.attributeBackground, Emacs.scroll-bar.attributeForeground)
and it it unlikely a user sets those. So if we find that those resources the
Gnome settings manager sets are set, we can with some confidence conclude that
the user did not set them.
But what should we do then? Ignore mode-line resources?
We would not want to simply ignore them, but we might want to
give them different priority compared with other kinds of color
specifications.
However, if we always give face customization precedence over
X resources, then we don't need to disinguish GNOME's X resources
from other X resources.