Foye's only basket of the game came after J.J. Redick left him to double Al Jefferson, whose cross-court pass was slightly off target.
"We played good defense," said coach Jacque Vaughn, "and they almost threw it out of bounds. ... Sometimes the basketball bounces your way, and sometimes it doesn't."
Orlando had a difficult time matching up with Jefferson, who scored 23 of his 31 points in the second half against Magic bigs Nikola Vucevic and Gustavo Ayon.
"Al stays within himself," Vaughn said. "He knows his game and makes his jump shots, which makes his post game even more difficult to guard."
Said Davis: "He's an All-Star. He can hit the jump shot, hook shot [and] through the middle. ... He's a good player."
Davis blamed a slow start for the Magic's demise.
They shot only 7-for-19 in the first quarter and fell behind 24-15.
For the game, Orlando missed 14 of its 15 3-point attempts.
Still, the Magic converted 10 of 13 possessions during one stretch of the fourth quarter to put themselves in position to win.
"It just shows how important it is to play the whole game," said Davis, who finished with 18 points and 12 rebounds in 39 minutes.
"... I commend our team for fighting back. It just shows how much character we have. But, at the same time, we can't shoot ourselves in the foot."
Orlando got Jefferson in foul trouble just before halftime, when he picked up his third personal and a technical foul from official Marat Kogut.
Jefferson was talking to Kogut as he headed toward the Jazz bench, when teammate Mo Williams jumped between the two and nudged Jefferson away.
"It was a bad call," Jefferson said, referring to his personal foul. "The referee came back at halftime and said he was sorry. [But] that don't take the tech away. ...
"I think Mo Williams was the reason I got the tech because he was trying to hold me back. I was just asking what I did. I wasn't being disrespectful. So I'm going to make him pay half of it."
Orlando could not take advantage of Jefferson's foul situation, however. He finished with only four before suffering back spasms. Jefferson left the game with 1:29 remaining after back-to-back baskets gave Utah an 85-81 lead.
"I thought we had good fight," said Aaron Afflalo, who scored 16 points. "Utah just made some really big shots down the stretch. ... Just unfortunate we lost tonight."