Heitinga - an 80th-minute replacement for Nikica Jelavic - drilled home a low shot after a mighty goalmouth scramble to sink the npower Championship hosts and send Everton through to round five.
Moyes had named his strongest possible line-up for their short trip to the Reebok Stadium and it looked set to pay off when a dominant opening spell was capped by Steven Pienaar's 18th minute goal.
But Dougie Freedman's underdogs hit back when Marvin Sordell swept home a 27th minute equaliser, and the home side had the better of the chances before Heitinga's late strike caused heartbreak.
Everton had looked classy from the start, Pienaar just failing to get on the end of a Jelavic cross in the opening minute, then Jelavic himself coming close after good work from Victor Anichebe.
And while there was touch of fortune about Everton's 18th minute opener it was certainly deserved, Leighton Baines feeding Victor Anichebe whose shot took a big deflection off Pienaar and found the net.
But there was an early blow for the visitors soon after when Kevin Mirallas, making his first start in almost two months, was forced off with what could have been a recurrence of his recent hamstring injury.
The home side belatedly started to get a grip on the game with Chris Eagles narrowly failing to beat the offside trap before Sordell, the two-goal scorer in the third-round replay at Sunderland, struck again.
In what constituted the home side's first chance of the game in the 27th minute, the energetic Darren Pratley swung in a low ball from the left and Sordell swooped into the box to drill a low shot past Tim Howard.
Incredibly Bolton almost grabbed the lead two minutes later when Eagles crossed from the opposite flank and Pratley smashed a fierce long-range shot which Howard well to parry on the edge of his six-yard box.
With the visitors reeling, Marcos Alonso came close on the half-hour when he cut into the left side of the Everton box and screwed a shot from a tight angle which Howard did well to keep out.
Chung-Yong Lee curled a shot just wide as Freedman's side, who had struggled to make an impression prior to Sordell's surprise leveller, finished an evenly-poised first period just about on top.
It was an advantage the Trotters maintained in the early stages of the second half as they swept the ball around with increasing confidence and came close through Alonso, who drilled a low shot straight at Howard.
Everton's response was patchy, Pienaar trying his luck with a looped shot from the corner of the box, but careless play by Marouane Fellaini almost cost the visitors dear in the 65th minute.
The Belgian gave the ball away to Josh Vela deep in the Bolton half sparking a swift counter-attack which saw Eagles burst down the left and cross into the box where Sordell was inches from connecting for a likely second.
After Andy Lonergan tipped another Pienaar effort wide, Bolton were boosted by Stuart Holden's first appearance at the Reebok Stadium since March 2011, when he replaced Vela for the final eight minutes.
But the day was to end in disappointment for the hosts when Heitinga fired home his dramatic winner - and it could have been even worse as fellow substitute Magaye Gueye rattled the bar soon after.
- Sports & Recreation
- Steven Pienaar
- Marvin Sordell