Stress is a major cause of many mental, psychological, emotional, behavioral, and physical disorders. Therefore, early detection of stress can help prevent many ailments and improve human health. In this study, we used a modified Stroop Color Word Task (SCWT) with time pressure and negative feedback to elicit two levels of stress at the workplace. We then assessed the level of stress using functional near-infrared spectroscopy (fNIRS) with multiple machine learning classifiers. We analyzed the fNIRS signals using partial directed coherence (PDC) to estimate the effective connectivity network between brain regions under stress. Our results showed that the proposed stress task reduced the cognitive performance and altered the connectivity network on the frontal region. The left frontal and left dorsolateral regions showed significantly higher connectivity under stress, p<0.05. Meanwhile, the right ventrolateral prefrontal cortex (VLPFC) showed a significant decrease in the connectivity network under stress. We achieved the highest classification performance using support vector machine (SVM) with an average classification accuracy of 99.93%. Our results highlight using fNIRS with PDC at the frontal brain region as a potential biomarker for stress.