“…so the object eyedropper in the sidebar is not relevant here.”
But it is, because it has the same Shortcut:

Anyway, yes the Sample Color is different than the Eyedropper.
Also, if you have the Mouse pointer over the 3D Viewport and then use SHIFT+X, it Samples the color under the Mouse Pointer.
If you have the Mouse Pointer over the Image Editor and hold SHIFT+X, it only samples colors when you’re over the Image Editor and gives black outside of it.
But Texture Painting is not Blender’s forte….and I haven’t used it a lot, so I am no expert.
Maybe what you want is possible, but I wouldn’t bet on it.