Cook overhauled Graham Gooch???s record of 8,900 Test runs in his 114th game shortly after lunch at Headingley, before going on to make 75.
Lyth (107) pressed on once his skipper had departed, securing his maiden ton on his home ground, but a flurry of late wickets saw England post 253-5 at stumps, 97 runs shy of New Zealand’s total of 350.
England had reduced the Black Caps to 297-8 overnight but were unable to polish off their opponents quickly on Saturday morning, with Mark Craig (41no), Matt Henry (27) and Trent Boult (15) finding the fence regularly.
The tourists plundered 53 runs from 7.1 overs before Stuart Broad (5-109 from 17.1 overs) had Boult pouched by Lyth at backward point to record his 13th five-wicket haul in Test cricket.
Cook and Lyth batted confidently, if not with the same panache as New Zealand???s lower order, before lunch, but it was later in the day when both men secured important personal milestones.
England skipper Cook, who made his England bow in 2006, clobbered Tim Southee through point for four to leapfrog his mentor Gooch, one of 12 boundaries the Essex star accrued en route to a 41st Test fifty.
The 30-year-old was unable to register a 28th Test ton, though, as he was given out lbw to Black Caps spinner Craig on review having shared a 177-run stand with Lyth, a record opening partnership for England at Headingley.
Lyth was in the nineties by that point and looking unsurprisingly fidgety but he delighted the Yorkshire faithful by clubbing Craig to the fence to reach his hundred off 188 balls.
The Whitby-born player ??? who posted seven and 12 on debut at Lord???s last week ??? saw his knock come to a close in disappointing style, however, when a mix-up with Gary Ballance resulted in him being run out by Boult.
Ballance (29 from 67) seemed out of sorts for much of his innings and was bowled by Boult with the third delivery after the new ball, while Joe Root (1) and Ben Stokes (6) fell before the close as New Zealand gained real momentum.