Bounding-box mechanism is a well-known low-cost localization approach for wireless sensor networks. However, the bounding-box location information cannot distinguish the relative locations of neighboring sensors, hence leading to a poor performance for some applications such as location-aware routing. This paper proposes a Differentiating Relative Locations (DRL) mechanism which uses a mobile anchor to broadcast tones and beacons aiming at distinguishing the relative locations of any two neighboring nodes. With the order of entering and leaving tone transmission range, each sensor is able to identify its relative location relation with each of its neighbors. In addition, two path planning mechanisms are proposed to guarantee that all sensors can identify their relative locations while the energy consumption of the mobile anchor can be effective. Theoretical analysis is developed to estimate the impacts of duty time of tone signals in terms of energy conservation and accuracy of relative locations. Experimental study reveals that the proposed mechanism effectively distinguishes relative locations of any two neighboring nodes and hence significantly improves the performance of location-aware routing in wireless sensor networks (WSNs).