Hendricks, who starred in his country's recent series win over England, continued his fine form by making 74 from 53 balls during the day-night match in Bristol to help the Proteas reach 211 for five.
The opener shared a third-wicket partnership of 112 with Markram, who smashed five sixes en route to hitting 56 from just 27 deliveries.
Spin bowler Gareth Delany claimed the wickets of Hendricks and Markram from successive balls in the 16th over but, despite a fine batting display from Lorcan Tucker, Ireland's chase ultimately fell well short.
Tucker, batting at number three, managed seven fours and five sixes in an impressive knock of 78 from 38 deliveries, while 43 from George Dockrell further boosted the Irish cause.
Yet hope of a famous win was effectively extinguished when the pair fell in the space of three balls to Tabraiz Shamsi and Dwaine Pretorius respectively.
Ireland, who finished on 190 for nine, will have another opportunity to claim a first victory in the format when the two sides meet again on Friday.
During the presentation ceremony, Hendricks said: "I think I've been working really hard. Momentum is important. I've been enjoying English conditions."
"We were in the game for a long time," said Ireland captain Andy Balbirnie. "The two wickets in two balls made the difference."