West Indies, who are attempting to square the series, were 276 for six at the close.
“We showed the fight we have been talking about,” said top-scorer Leon Johnson, who made 54.
“We are one or two wickets too many down but we’re very happy with the position we’re in.”
If the West Indies were happy, the same applied to Harmer, who was added to the South African squad three days ago and told on Thursday he would be making his debut in place of leg-spinner Imran Tahir.
Harmer took three for 67 and was mainly responsible for the West Indies slipping to 172 for five, dismissing Devon Smith, Johnson and Shivnarine Chanderpaul during an impressive first day of Test cricket.
“Since I was four years old I have always wanted to play for my country but if you had told me ten days ago that I would be sitting here I probably would have slapped you,” he said.
Harmer, 25, attributed his successful transition to the Test arena to a strong domestic cricket competition in which he plays for the Eastern Cape Warriors franchise.
He said the key to his success on Friday was finding the right length.
“If it’s not turning you want to attack with your length,” he said.
Ramdin (53) and Jermaine Blackwood (45 not out) put on 94 for the sixth wicket to enable the tourists to finish with a respectable total after it seemed they had squandered the advantage of winning the toss and batting first on an easy-paced pitch.
Harmer took a wicket with the last ball of his fourth over. It was also the last ball before lunch and came from a disappointing shot by Smith, who chopped the ball into his stumps after battling to 47.
Johnson played some handsome strokes in making 54 off 84 balls with nine fours before he was deceived by a quicker ball from Harmer which curved in with the arm and struck the batsman on his front pad deep in his crease.
– Steyn passes Ntini –
The leg before wicket decision was so obvious that Johnson did not even contemplate asking for a review, departing for the dressing room immediately.
Samuels looked in good form, scoring 43 off 70 balls, but hung his head in shame after playing a loose drive against the first ball sent down by part-time bowler Stiaan van Zyl, bowling at a gentle medium pace. The ball went straight to Faf du Plessis at cover.
Worse for the West Indies was to follow with the first ball after tea.
Harmer fired the ball down the leg side and Chanderpaul was smartly stumped by AB de Villiers.
Chanderpaul was out for nine — his fourth successive failure in a series in which he has scored only 41 runs in four innings.
It looked like a planned move but Harmer admitted: “I bowled it too straight. It was a brilliant take and stumping by AB.”
Ramdin, whose previous highest score in eight Tests against South Africa was 32, struck the ball solidly in making his half-century before falling to Dale Steyn shortly before the close.
He mistimed a slower ball to offer a return catch to the fast bowler.
Steyn took the first wicket of the match when he had Kraigg Brathwaite caught at gully.
His two wickets for the day took him to 391 Test wickets and second place on South Africa’s all-time wicket-taking list, one ahead of Makhaya Ntini and behind only Shaun Pollock, who took 421.
Blackwood was picked as an extra batsman in place of left-arm seamer Kenroy Peters and justified his selection with a dogged innings, although De Villiers put down a thick edge off Harmer when he was on 13.
There was less assistance than expected for the seam bowlers, despite the pitch having a good coverage of grass, and South African captain Hashim Amla used Harmer for 25 overs, while part-timers Van Zyl and Dean Elgar bowled eight and two overs respectively. -AFP