England striker Davies smashed the ball home from close range in the 83rd minute, after York, of the Blue Square Premier, had almost taken a shock lead at the other end.
The teams had looked to be heading for a Bootham Crescent replay before Davies, who boss Owen Coyle brought off the bench for the second half, intervened, and Elmander finished off York in the 89th minute with a sweet strike from 25 yards.
Gary Mills' York side gave an inspired performance as Bolton struggled to live up to their Premier League status, before the extra quality of the top-flight side brought them their victory.
York were followed across the Pennines by 4,900 supporters, and many would have had fond memories of the club's past cup exploits, notably their 3-0 League Cup win over Manchester United at Old Trafford in 1995.
A small number would have witnessed the club's run to the FA Cup semi-finals in 1955, when among their victims were a Blackpool side featuring Stanley Matthews and Stan Mortensen, and Tottenham. That York team lost a semi-final replay to Newcastle at Roker Park, and were dubbed 'The Happy Wanderers'.
Tamir Cohen returned to Bolton's team for the first time since the death of his father Avi, the former Liverpool player.
His inclusion was one of six changes to the team that drew against Wigan in the Premier League on Wednesday. Adam Bogdan, Ivan Klasnic, Martin Petrov, Robbie Blake, Cohen and Marcos Alonso came in, while Jussi Jaaskelainen, Paul Robinson, Matt Taylor, Davies, Fabrice Muamba and Johan Elmander dropped to the bench.
The visitors had a clear opening in the fifth minute when Ashley Chambers breached the Bolton defence, but rather than shoot, which seemed the obvious option, he looked to square the ball to striker Michael Rankine and the pass went astray.
Chambers had the next chance too, in the seventh minute, when he darted in from the right flank before shooting wide of the right post from 12 yards.
Rankine drilled another effort the wrong side of the same post as York's bright start continued.
Cohen had Bolton's first attempt on Michael Ingham's goal but fired a shot high and well wide from 25 yards.
The hosts were probing and pushing passes around York but the non-league side were not apparently overawed by their task.
Rankine had a half-chance with his back to goal, but the striker's overhead kick did not trouble Bogdan.
Chris Carruthers did well to block a shot from Rodrigo inside the penalty area, before Ingham had to beat away a 30-yard drive from Gary Cahill, yet the home supporters were growing restless.
Cahill sent a header wide in the 39th minute as he got forward to meet Blake's free-kick, but Bolton could not find a way ahead in the first half.
That meant York, who beat Kidderminster in the final qualifying round before knocking out Rotherham and Darlington, had still to concede a goal in this season's competition.
Davies replaced the almost-anonymous Klasnic for the second 45 minutes, and almost scored immediately as Bolton swept forward from the kick-off, only for his shot to be charged down by Carruthers.
From the corner which followed, Petrov swung the ball across and the ball hit Davies before being cleared off the line by Parslow.
York then had the chance minnows dream of when Neil Barrett was left unmarked six yards out but failed to find the target, planting a header wide from Carruthers' left-wing cross.
Cohen was replaced by Taylor with half an hour remaining, and York made their first substitution five minutes later as Peter Till replaced Chambers.
Eager to win the tie at the first attempt, Coyle took off Blake and introduced Elmander.
Barrett should then have buried a chance when Till's sweet cross picked him out and the midfielder shot towards the bottom-right corner, only for Bogdan to make a superb diving stop to push the ball behind.
Barely a minute later and the cost of that miss was laid bare, as Petrov crossed from the left and Davies smashed the ball into the top-left corner.
Elmander found the same corner from 25 yards, with a fine strike in the 89th minute, to kill off any hopes York had of a late leveller.