I'm curious why the D# sounds good in the guitar solo of Pink Floyd's Mother. You can check for example the tab here - the 14p13 is a pull-off from E to D#, but D# isn't in the G major scale even though Mother is in the key of G major.
Basically, D♯ doesn't mean he's playing the ♯5 in this case. He's playing the ♮7 in E minor.
The solo is played in the key of E minor (which is G major's relative minor), and a common thing to do when in minor is to raise the 7th degree, often for harmonic purposes (it creates a leading tone, because D♯ resolves better to E than D does). You'd never guess that they call it harmonic minor. Another common thing to do is to raise both the 7th and the 6th, making melodic minor.
So, one is soloing in E minor, the relative minor of G major, and one uses the harmonic minor scale to get that D♯ in the solo.