Through infrared spectroscopy, we systematically study the pressure effect on electronic structures of few-layer black phosphorus (BP) with layer number ranging from 2 to 13. We reveal that the pressure-induced shift of optical transitions exhibits strong layer dependence. In sharp contrast to the bulk counterpart which undergoes a semiconductor to semimetal transition under ∼1.8 GPa, the band gap of 2 L increases with increasing pressure until beyond 2 GPa. Meanwhile, for a sample with a given layer number, the pressure-induced shift also differs for transitions with different indices. Through the tight-binding model in conjunction with a Morse potential for the interlayer coupling, this layer- and transition-index-dependent pressure effect can be fully accounted. Our study paves a way for versatile van der Waals engineering of two-dimensional BP.