The aging of population has become a global trend and the critical knowledge of enterprises may be lost with the retirement of senior employees. Task-based cooperation is an important method to prevent the loss of knowledge and to promote the knowledge sharing behavior between senior employees and young ones. This paper constructs the knowledge contribution payoff functions of senior employees and young ones in the context of task-based cooperation and analyzes the knowledge contribution behavior using static game theory with complete information, and then we obtain Nash equilibrium solutions under different conditions. The results suggest that enterprises can promote knowledge contribution of senior employees and young ones in the process of task-based cooperation by improving social rate of return(e.g., creating a good cultural atmosphere), reducing cost rate of knowledge contribution (e.g., training on knowledge expression), raising economic rate of return and providing monetary compensation according to the contribution of knowledge, whether the marginal payoff of employees’ knowledge contribution is increasing, invariant or diminishing. Since the formation of social return is difficult in the short term, giving economic incentives can be an effective way at the beginning. With the progress of task-based cooperation between senior employees and young ones, the amount of employees’ knowledge (especially of young ones’), the productivity of knowledge contribution, the collaborative efficiency and social rate of return will increase and therefore economic incentives contributing to cooperation between both players may decrease appropriately. The findings of this paper are beneficial to understand knowledge sharing behavior in the context of task-based cooperation, and provide several incentive mechanisms for enterprises to promote knowledge sharing between senior employees and young ones.