Lyon finished with 3-61 as New Zealand were dismissed for 370 with McCullum having scored the world's fastest test century from 54 balls, hitting 16 fours and four sixes to reach 100 as he beat the previous mark by two balls.
Anderson, who combined with McCullum in a 179-run partnership, scored 72 before he became Lyon's first wicket shortly before tea at Hagley Oval.
McCullum was dismissed for 145, with wicketkeeper BJ Watling last man out for 58, his 11th test half century, as the hosts posted a target that earlier seemed improbable when they had been reduced to 32 for three in the first session.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
(Reporting by Greg Stutchbury; Editing by Ian Ransom)
