World number one McIlroy started the round four shots off the pace and made an early charge, with birdies at the first, third and sixth holes in a bogey-free front nine at Chapultepec Golf Club.
But a bogey five at the 12th cost McIlroy his momentum as Reed and countryman Bryson DeChambeau surged clear.
Starting the day one off the pace, the 29-year-old Reed was two under through a bogey-free first 14 holes, including a stretch of 10 successive pars from the second to the 11th.
DeChambeau set the course alight en route to the day's second-best round, making eight birdies and one bogey through his first 14 holes to challenge for victory.
But Reed responded beautifully with three straight birdies from holes 15 to 17.
And when DeChambeau made three putts for a bogey four at the 17th, it meant Reed could afford his own bogey, on the 18th, and cling on for a one-shot win, his four-under 67 leaving him at 18-under 266.
The 26-year-old DeChambeau had to settle for a six-under 65.
McIlroy's three-under 68 left him four shots behind Reed and one shot behind joint third-placed Jon Rahm of Spain and South African Erik van Rooyen, who shot 67 and 70 respectively.
England's Tyrrell Hatton completed four sub-par rounds with a three-under 68 to grab a share of sixth place at 13 under, alongside overnight leader Justin Thomas and Japan's Matsuyama Hideki.
Hatton made five birdies against one bogey through 15 holes but tarnished his work with a bogey four at the 17th.
England's Paul Casey was a further two shots back in 11th place after a one-under 70.
Tommy Fleetwood shot a 69 to share 18th place at six under, while Lee Westwood was the fifth Briton to play four rounds under par, his third straight one-under 70 leaving him tied for 22nd.
Reed said the win felt "very rewarding".
"My team and I, we've worked so hard through the end of last year and also at the beginning of this year and kept on feeling like we were playing some good golf, just we weren't quite able to get over that hump," he told the European Tour's website.
"To come back and win my second World Golf Championship, especially with how I had to finish from basically 15 onwards ... the last hole was ugly but it was what I needed just to get the job done.
"And I think because of that, it just has built up so much confidence with how I've played so far in my career with putting myself in these positions, I feel like I have a chance to continue and to have a chance to win these golf tournaments. The confidence is through the roof."