EX Lup is the prototype of the EXor class of young eruptive stars: objects showing repetitive brightenings due to increased accretion from the circumstellar disk to the star. In this paper, we report on medium-resolution near-infrared spectroscopy of EXLup taken during its extreme outburst in 2008, as well as numerical modeling with the aim of determining the physical conditions around the star. We detect emission lines from atomic hydrogen, helium, and metals, as well as first overtone bandhead emission from carbon monoxide. Our results indicate that the emission lines are originating from gas located in a dust-free region within approximate to 0.2 AU of the star. The profile of the CO bandhead indicates that the CO gas has a temperature o...