Stochastic multicompartmental systems: a counting process approach for parameter estimation