Anderson, competing in his second Test, smashed 13 fours and two sixes in his 116 before being caught at extra cover by Sohag Gazi to give seamer Al-Amin Hossain his first Test wicket.
After a 20-minute rain delay, New Zealand resumed the third day on 107 for three, in reply to the hosts' first innings of 282 all out, and looked in trouble when Ross Taylor was removed for 53 in the fourth over by Shakib Al Hasan.
The former captain was caught in the slips by Nasir Hossain, leaving the visitors on 127-4.
But in stepped the 22-year-old Anderson, who put on 140 for the fifth wicket with Kane Williamson (62), to help the tourists close on the hosts' total.
Williamson departed after a miscue to deep mid-wicket off the bowling of Abdur Razzak before Anderson followed eight overs later to leave the Black Caps on 287 for six, but wicketkeeper BJ Watling (59 not out) steered the tail expertly.
Doug Bracewell (17) and Neil Wagner (8) held up the Bangladeshi charge before Kiwi spinner Ish Sodhi struck his first Test half century to sit unbeaten on 55 with Watling when stumps was called.
Bangladesh are looking for their first Test victory over New Zealand.
The first Test in the series was drawn.
Scorecard
Bangladesh (1st innings): (overnight 228-5)
Tamim Iqbal c Williamson b Wagner 95
Anamul Haque c Williamson b Boult 7
Marshall Ayub b Wagner 41
Mominul Haque c Watling b Anderson 47
Shakib Al Hasan lbw b Sodhi 20
Mushfiqur Rahim c Fulton b Wagner 18
Nasir Hossain c Taylor b Sodhi 19
Sohag Gazi c Williamson b Wagner 14
Abdur Razzak b Sodhi 13
Rubel Hossain c Watling b Wagner 4
Al-Amin Hossain not out 0
Extras: (b2,lb1, w1) 4
Total: (all out, 74.5 overs) 282
Fall of wickets: 1-23, 2-90, 3-166, 4-208, 5-228, 6-246, 7-252, 8-266, 9-274, 10-282.
Bowling: Boult 16-2-55-1, Bracewell 14-1-57-0, Wegner 19-5-64-5, Sodhi 18.5-3-59-3, Williamson 4-0-30-0, Anderson 3-0-14-1.
New Zealand (1st innings):
P Fulton lbw b Shakib 14
H Rutherford c Mominul b Shakib 13
K Williamson c Tamim b Razzak 62
R Taylor c Nasir b Shakib 53
B McCullum c Rubel b Shakib 11
C Anderson c Gazi b Al-Amin 116
BJ Watling not out 59
D Bracewell c Mushfiqur b Shakib 17
N Wagner c Marshall b Nasir 8
I Sodhi not out 55
Extras: (b4, lb4, wb2, nb1) 11
Total: (for eight wickets, 133 overs) 419
Fall of wickets: 1-31, 2-32, 3-101, 4-127, 5-267, 6-287, 7-318, 8-335.
Bowling: Al-Amim 16-3-58-1, Sohag Gazi 34-8-77-0, Shakib 40-13-97-5, Razzak 19-1-84-1, Rubel 18-1-81-0, Nasir 3-1-7-1, Mominul 3-0-7-0.
Image: Corey Anderson
Photograph: Gareth Copley/Getty Images
Rain respite for Kiwis after Shakib strikes thrice
Tamim misses century as Kiwis toil on rain-hit opening day
Record man Gazi helps Bangladesh register draw against NZ
Pujara stays at seventh in Test rankings
Rain and Bangladesh tail leave NZ Test heading for a draw