Using density functional slab calculations with planewave basis set and pseudopotentials, we have examined the effect of subsurface boron and phosphorus on the surface chemical properties of Si(001). We compare the adsorption behaviors of water and ammonia between B- or P-modified and clean Si(001) surfaces. On the B-modified surface, the charge polarization of two B-connected dimers is altered significantly. Our calculation shows that approximately one electron is transferred from the local surface to the subsurface boron, thereby leading both buckled-up and -down atoms of B-connected dimers to be electron-poor (electrophilic). On the other hand, subsurface P brings about no significant change in surface electronic structure. Only about one-tenth of an electron is transferred from the subsurface P to the local surface. As a result, relative to the clean surface, the adsorption properties of water and ammonia change noticeably on the B-modified surface while varying insignificantly on the P-modified surface.