Greens overtake Labour in poll after stunning by-election victory