HP had 21.8 percent market share in Q3 2017, while Lenovo registered 21.4 percent market share in terms of PC shipments.
However, "HP Inc. is in an upward trend as it has experienced five consecutive quarter of global PC growth, while Lenovo is in a downward trend with declining shipments in eight of the last 10 quarters," Gartner said.
Worldwide PC shipments reached 67 million units in the third quarter of 2017 - a 3.6 percent decline from the third quarter of 2016.
This is the 12th consecutive quarter of declining PC shipments, according to Gartner.
"While there were signs of stabilisation in the PC industry in key regions, including EMEA (Europe, the Middle East and Africa), Japan and Latin America, the relatively stable results were offset by the US market, which saw a 10 percent (year-over-year) decline," said Mika Kitagawa, Principal Analyst at Gartner.
In Asia-Pacific, PC shipments reached 24 million units in the third quarter of 2017 - down 2.1 percent from the same period last year.
HP Inc experienced growth in all key regions, except the US market.
The company experienced double-digit growth in Latin America while in Asia/Pacific, HP Inc secured positive growth for the fifth consecutive quarter.
Lenovo experienced its steepest year-over-year decline of PC shipments in the US since it acquired the IBM PC business division in 2005.
Dell's worldwide PC shipments were slightly down compared with a year ago, as it registered its first year-over-year shipment decline since the first quarter of 2016.
While consumer demand remained lacklustre, PC demand in the business segment remained steady, especially for notebooks.
"In China, the PC market is estimated to have declined by 5 percent in the third quarter of 2017, with more stability in the business market, particularly in large enterprises, than in the consumer space," Gartner said.