A mid-infrared cavity-enhanced sensor system was demonstrated for the detection of formaldehyde (H2CO) using a continuous-wave (cw) interband cascade laser (ICL) centered at 3599 nm. A compact Fabry-Perot (F-P) cavity with a physical size of 38 × 52 × 76 mm3 was developed consisting of two concave mirrors with a radius of curvature of 80 mm and a reflectivity of 99.8% at 3.6 μm. Different from the widely reported electro-optical (EO) external modulation based Pound-Drever-Hall (PDH) locking technique, a radio-frequency electrical internal modulation based PDH technique was used for locking the laser mode to the cavity mode. A dual-feedback control on the laser current and on the piezo transducer (PZT) displacement was utilized for further stabilizing mode locking. A 20 m effective optical path length was achieved with a cavity length of 2 cm and a finesse of 1572. The effectiveness and sensitivity of the sensor system were demonstrated by targeting an absorption line at 2778.5 cm-1 for H2CO measurements. A linear relation between the cavity transmitted signal amplitude and the H2CO concentration was obtained within the range of 0-5 ppm. A 1σ detection limit of 25 parts-per-billion (ppb) was achieved with an averaging time of 1 s based on Allan-Werle variance analysis. The reported dual-feedback RF modulation based PDH technique led to a method for gas detection using a similar experimental setup and measurement scheme.