Mean-field approximation of counting processes from a differential equation perspective