FA Cup: Aston Villa 2 Bournemouth 1
Paul Lambert's men have found goals hard to come by of late - scoring just once in their previous six outings in all competitions prior to the tie - but Gil's stunning 51st-minute strike, along with an Andreas Weimann effort 20 minutes later, will give the club's fans cause for optimism.
Championship leaders Bournemouth looked bright during the first half and went close twice through midfielder Shaun MacDonald, who saw one effort cleared off the line by Kieran Richardson.
Eunan O'Kane also looked dangerous for the visitors at Villa Park, but the home side came out for the second period with renewed energy.
After going close moments earlier, Gil – who arrived from Valencia for an undisclosed fee earlier this month – curled in a sublime left-footed strike to give Villa the lead.
Weimann found the net in the 71st minute, but substitute Callum Wilson set up a tense finish with a goal three minutes into stoppage time for Bournemouth, who have scored more goals in one match – an 8-0 win at Birmingham City in October – than Villa have managed at home all season in the Premier League (seven).
However, Villa clung on to take their place in the fifth round with their first goals since beating Blackpool 1-0 in round three.
Villa announced a new long-term deal for Fabian Delph in the build-up to kick-off, but there was no place for the England midfielder in Lambert's matchday squad, while Bournemouth made eight changes from their last Championship outing.
It was the visitors who forced the first opening, with MacDonald sending a deflected effort over the crossbar after good work by Ryan Fraser.
Shay Given then had to get down to keep out a Harry Arter strike from the edge of the penalty area, before Weimann headed just wide at the other end.
Former Swansea City midfielder MacDonald continued to cause problems for the Villa defence and was denied by a Richardson block on the line after rounding Given in the 18th minute.
Despite making wholesale changes, Bournemouth were holding their own against top-flight opposition and O'Kane saw an effort tipped around the post by Given shortly after the half-hour mark.
Gil found the side-netting after some neat build-up play from Christian Benteke at the beginning of the second half, but the Spaniard was on target with a sensational strike soon after.
After cutting onto his left foot on the right of the penalty area, Gil sent a wonderful curling effort beyond Lee Camp and into the Bournemouth net.
Weimann appeared to have made sure of a place in the next round when he slotted home from 12 yards after a cutback from Alan Hutton, but Bournemouth refused to go down without a fight.
Substitute Simon Francis fired just wide before fellow replacement Wilson squeezed the ball past Given from close range.
Despite the late drama, Villa held on for a result that marks the first time they have won by more than one goal since a 3-1 Premier League victory against Hull City in May.