The idea of a piece of music being in a key only works neatly when that music sticks to the set of seven notes implied by a particular key signature. As you've noticed, some music - quite a lot of music, in fact - doesn't fit this pattern, and wants to dip its toes in the water of the other 5 notes in the 12-tone scale (and beyond, in the case of blues-influenced music!)
What most people do here is see that the piece has a tonal centre of E, and a basically major tonality (G#, the major third, rather than G, the minor third, is in evidence for most of the piece), and as the piece doesn't clearly move to another key for any length of time, it would simply be notated in E Major, so that's what would be called the key...
But if you hear a clear change in tonal centre during the D A C G section, you are free to consider that the song modulates - sometimes it almost seems that some rock progressions are switching key with every chord change. If thinking in terms of borrowed chords is helpful and works for you as a way to not have to mentally change key, then use that.
Rock music is often a mixture of usages of major and minor keys, other modes, the blues scale (which is a bit different again), and sometimes is just about throwing a chord shape or two around the fretboard and making it work. Bear all those things in mind - rather than just thinking in terms of a piece being in one key - and it will hopefully start to make more sense.