Bowling on a grassy pitch and under an overcast sky, the 29-year-old right-armer enticed Cook to edge behind to wicketkeeper Dinesh Chandimal off just the fourth ball at Newlands.
Cook had made 59 and 117 in the first Test at Port Elizabeth which South Africa won by 206 runs.
Fellow opener Dean Elgar hit the first Test runs of the new year when the left-hander pushed for three through the covers.