The Cowboys faced a 35-32 halftime deficit and trailed 55-48 when KSU's Curtis Kelly completed a 3-point play with 8:41 left in the second stanza.
Anderson's free throws put OSU in front 63-58 with 3:02 left and the lead lasted until the end.
Obi Muonelo had 14 points and eight rebounds, Nick Sidorakis scored nine with four rebounds, while Matt Pilgrim added six points and seven rebounds for the Cowboys (15-4, 3-2 Big 12), who have won their last two contests.
Denis Clemente led Kansas State with 19 points.
Curtis Kelly scored 13 with seven rebounds, four assists, three steals and five blocked shots, while Jacob Pullen added 11 points, five rebounds and six assists for the Wildcats (16-3, 3-2), who had won three in a row.
'Happy' fan videos make Pharrell cry [VIDEO]
Pregnant Mila Kunis wins 'Best Villain' at MTV Movie Awards