Will Ferrell's Thanksgiving turkey was thiiiiiis close to being overcooked this year ... 'cause the house he was celebrating at CAUGHT ON FIRE ... TMZ has learned.
Will was in the middle of his Turkey Day dinner at a family member's home in Needham, Mass ... when one of the kids in the house noticed a fire had broken out in the garage and someone in the house immediately called for help.
Law enforcement sources tell us ... the local Fire Dept. raced to the scene and quickly extinguished the fire -- no injuries, no major damage.
We’re told Will was super nice to the responding firefighters -- cracking jokes and taking pictures -- and totally made them forget that they got screwed into working the Thanksgiving shift.