Multivariate brain decoding (MBD) can be applied to estimate mental states using brain signal measurements. In the best scenario, a MBD model should be trained in a first set of volunteers and then validated in a new and independent dataset. Here, we aimed to evaluate whether functional near-infrared spectroscopy (fNIRS) signals from frontal and occipital areas provide enough information to discriminate affective states. For this purpose, a linear discriminant analysis classifier was trained in a first database (49 participants, 24.65±3.23 years) and tested in an independent database (20 participants, 24.00±3.92 years). Significant accuracies were found for positive vs. negative (64.50±12.44%, p<0.01) and negative vs. neutral (67.75±14.45%, p<0.01) affect during a passive elicitation condition, consisting in viewing pre-validated images with emotional content. For the active elicitation condition, in which volunteers were instructed to recollect personal affective experiences, significant accuracy was found for positive vs. neutral affect (71.00±17.93%, p<0.01). In this last case, only three fNIRS channels were sufficient to discriminate between those affective states: two positioned over the left ventrolateral prefrontal area and one over the right lateral orbitofrontal cortex. In conclusion, our results show that fNIRS is a feasible technique for intersubject affective decoding, reaching significant classification accuracies using a few and biologically consistent features.