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.
But after holding their own, Petrov crossed from the left for Bolton and Davies smashed the ball into the top-left corner before Elmander found the same corner from 25 yards with a fine strike in the 89th minute.