Guiseley joint-manager Marcus Bignot said: “I’m delighted with how we played, to come to the side who are top of the table and win, it is a big three points. The players have worked really hard and to get this victory means a lot.”
With moments to go until half-time, Guiseley took the lead when Alex Purver put in a great delivery, and Kayode Odejayi was well-placed and flicked his header in to the delight of the away support.
The hosts started the second-half well and Jake Beesley was thwarted by Dewhurst.
An ex-Guiseley player would level the scores when Nicky Clee crossed and Oli Johnson took the knockdown and scored.
Momentum seemed to be with Avenue but Guiseley went up the other end, and a low cross found Rowan Liburd who produced an improvised finish to give the Lions the lead again.
Avenue were reduced to 10 men when Jamie Spencer was sent off for two yellow cards.
Bradford boss Mark Bower said: “I thought it was a tight game, the pitch suited them a little bit more than us, I’m disappointed with the way we lost.The reaction from the players is key now, we know we can go on another unbeaten run.”
Hamza Bencherif scored his first competitive goals for York City as they gained their own revenge over Darlington at Bootham Crescent.
The French-born defender scored twice as the Minstermen avenged their 5-1 Boxing Day defeat against the Quakers at Blackwell Meadows.
Strikers Jordan Burrow and Jake Wright were also on target as City opened 2019 in style and moved up to 13th in the standings.