Casting order matters
My opinion on this changed after considering "Can I stop previously cast spells from affecting me by moving into a globe of invulnerability?"
In your example, the lich cast globe of invulnerability after the party cast magic weapon. The globe only blocks spells cast from outside. Before globe of invulnerability is cast, there is no inside or outside of the globe, because there is no globe. Therefore, it does not affect spells that were cast before it.
Magic weapon will not work within the globe if cast after it
If the lich instead cast globe of invulnerability before the party cast magic weapon, the answer is different.
The spell magic weapon is cast on a weapon, not on the lich itself, so does it still count as affecting the lich? For this spell in particular, it doesn't matter. The weapon is an object and globe of invulnerability prevents objects from being affected by spells cast outside the globe. It doesn't matter if the object was previously outside; once it is used to attack, it (or its ammunition) must enter the globe, and thus cannot be affected by magic weapon.
Word of God
For more about what it means for a spell to affect a creature, we take a look at the Rakshasa (MM 257), which has the following property:
Limited Magic Immunity. The rakshasa can't be affected or detected by spells of 6th level or lower unless it wishes to be.
Jeremy Crawford has answered a question about this property in a Sage Advice tweet.
@JeremyECrawford Hi Jeremy, does a Rakshasa's 'Limited Magic Immunity' protect it from weapons enhanced by shillelagh or the magic weapon spell since they are spell effects?
- Vitrax (@Spooky_Wizard)
Shillelagh and magic weapon are spells. Limited Magic Immunity prevents a rakshasa from being affected by spells of 6th level or lower, unless it wishes to be. #DnD
- Jeremy Crawford (@JeremyECrawford)
It seems clear that "the rakshasa can't be affected" is equivalent to "any spell [...] can't affect". Thus, magic weapon will not affect the lich if cast after the globe.