This study investigated the relationship between workplace ostracism and nurses’ tendency to engage in counterproductive work behaviours. The healthcare sector worldwide, and especially in developing countries, faces serious problems because the demand for healthcare professionals is increasing due to rapid population growth. Nursing staff plays an important role in this regard, especially in the current COVID‐19 pandemic. However, nursing staff sometimes tends to engage in counterproductive work behaviors (CWBs), aggravating the problem. Workplace ostracism and job stress may be the factors associated with the tendency of nursing staff to engage in CWB. Therefore, this problem needs further investigation so that appropriate strategies may be developed to control their engagement in CWB. A time‐lagged survey was conducted in public‐sector hospitals of Pakistan to collect data from the nursing staff. Workplace ostracism was found to be positively related to nurses’ feelings of job stress and their tendency to engage in CWB. Similarly, job stress was positively related and emotional intelligence was negatively related to nurses’ tendency to engage in CWB. Job stress was found to mediate the relationship between workplace ostracism and CWB. Emotional intelligence was found to moderate the positive association between workplace ostracism and CWB mediated by job stress.