The worldwide smartphone market saw record sales in the quarter, with growth of 38.8 percent from a year ago and 258.4 million units sold, the IDC survey said.
The South Korean electronics giant Samsung widened its lead, shipping 81.2 million smartphones, boosting its market share by nearly half a percentage point to 31.4 percent.
Apple sold 33.8 million iPhones in the quarter, but its growth was slower than the overall market, so its share slipped to 13.1 percent from 14.4 percent a year ago.
China's Huawei moved into third place, propelled by 76 percent year-over-year growth. It sold 12.5 million smartphones, grabbing a market share of 4.8 percent, just ahead of the 4.7 percent for fellow Chinese firm Lenovo.
South Korea's LG slipped from third to fifth place, with a 4.6 percent share, despite sales growth of 71 percent.
"Beyond Samsung and Apple at the top of the rankings is a tight race of vendors trying to break out from the pack," said IDC analyst Ramon Llamas.
"Chinese vendors Huawei and Lenovo moved past LG, and not far behind are two more Chinese companies, Coolpad and ZTE."
The survey did not break down the market share for Android, the dominant operating platform from Google.
But a separate report from ABI Research said Android's global market share reached a record 80.6 percent. ABI estimated Apple's share at 14 percent, with Windows Phone at four percent and BlackBerry 1.5 percent.
"The race for the third ecosystem is clearly favoring Windows Phone... but there remains little opportunity for new market entrants to make a significant impact on Android's dominance," said ABI analyst Michael Morgan.
ABI's estimate showed 244 million smartphones shipped, with Samsung's share at 35 percent and Apple's 14 percent.
ABI said it expects Apple to sell a record 53 million iPhones in the fourth quarter, but that this would boost its market share only to 18.7 percent.
IDC's Llamas said the smartphone market is still growing at a solid pace and expects annual sales of one billion units in 2014.
The overall mobile phone market grew 5.7 percent from a year ago to 467.9 million units, with Samsung on top with a 24.7 percent market share, IDC said.