PurposeThe study aims to describe the impact of supervisor’s and co-worker’s ostracism on the employee's responses (emotional, psychological and behavioral) through the mediation of employees' efficacy needs and relational needs. Moreover, psychological capital is treated as a moderator to handle the adverse responses of ostracized employees.Design/methodology/approachThe study employed a three-wave quantitative research design to gather data from employees and their respective supervisors who belonged to various healthcare units (N = 510) using self-administered close-ended questionnaires. After that, SmartPLS software was used to analyze the data through a structured equation modeling (SEM) technique.FindingsThe empirical results of the study endorsed that ostracism adversely (negatively) affects employees' responses (comprised of emotional, behavioral and psychological). Moreover, the results revealed that employees' needs (efficacy and relational) mediate the relationship between ostracism experienced by employees (supervisor’ and co-workers’ ostracism) and their emotional, behavioral and psychological responses. In addition, it is also evidenced that employees' psychological capital improves the negative association between employees' needs and responses.Originality/valueThe literature in this domain is scarce, and the theoretical stance is weak due to the traditional approaches that are more concerned with the outcomes rather than analyzing the employee's conditional what they are going through. The present study enhances the knowledge of the transactional mode of coping and its application to ostracism in the workplace. The results of the current study may also support the practitioners in formulating interventions to foster a favorable workplace environment.