South Africa were 100 for no wicket at lunch at Centurion's SuperSport Park. De Kock, the South African wicketkeeper, was moved up to open the batting which he does regularly in limited overs internationals after regular opener Dean Elgar sprained an ankle during fielding practice on Friday.
Stiaan van Zyl came into the side and was expected to bat at number seven. De Kock was the more aggressive batsman, reaching 58 not out at lunch, while Cook again played a cautious opener's role.
De Kock reached his half-century when he punched Boult through the covers off the back foot for his tenth boundary.
Tim Southee and Trent Boult bowled testing opening spells, gaining some movement through the air and off a slow-paced pitch.
Cook survived a confident appeal for leg before wicket by Boult in the fourth over when he was on one. The ball swung in sharply from the left-armer with the batsman back on his stumps.
Umpire Paul Reiffel turned down the appeal and a New Zealand review failed when replays showed a faint inside edge onto the pads.
Ironically, New Zealand did not seek a review when Cook was struck on the pads by Neil Wagner when he was on 36.
The Black Caps and umpire Ian Gould probably thought the ball had pitched outside leg but replays showed it landed in line with the stumps and would have hit leg stump.
South Africa first innings: S. Cook not out 40 Q. de Kock not out 58 Extras (lb2) 2 Total (0 wkts, 28 overs) 100 Bowling: Southee 8-1-26-0, Boult 8-1-25-0, Bracewell 6-1-26-0, Santer 2-0-9-0, Wagner 4-1-12-0.