Considering the context,I think James 4:5 is actually speaking of a bad spirit, not the holy spirit. A spirit of envy.