The problem with your proposal is the spacing of 9 and 10 speed cassettes is different. The 9 speed shifter will pull the 9 speed amount of cable and the derailleur will move the 9 speed space between cassette cogs. If the cassette is a ten speed with 10 speed spacing, the cable pull and derailleur movement (being 9 speed) will be off and shifting will be poor. In addition, the 9 speed shifter will only have 8 detents and can't gain any more. Thus, even if spacing wasn't a problem, one of the 10 speed cogs would be left out.
Now what does work mixing Shimano speed groups is at the derailleur. Any Shimano 7-9 speed plus 10 speed road rear derailleurs will work correctly in any of these speed class systems. In other words, a 7 speed rear derailleur (or an 8 or 10 speed) will work just fine with your 9 speed shifter and 9 speed cassette. This is due to all these speed classes of rear derailleur share the same "actuation ratio." These derailleurs move the same amount per mm of cable pulled by the shifter. The shifter, by it's designed amount of cable pull per lever throw, and the number of "clicks" determines the "speed" of the system, and must be paired with the cassette of that same speed for the system to work correctly. You can certainly use the RD-5701 with your current 9 speed shifter and 9 speed cassette.
To sum up, differing speeds do have different cable pulls and the cassette's have different spacing. The shifter and cassette must match in the speed since a certain, set amount of cable must be pulled by the shifter to move the derailleur the particular intercog spacing of the cassette. Derailleurs (of the above mentioned speeds) can be interchanged between speeds.
One note about derailleurs: there are other parameters that make a derailleur compatible in a given system. While all these speed classes of derailleur share the same actuation ratio and respond (lateral movement wise) the same to shifter input, they aren't necessarily interchangable within every set-up of these speeds. Each derailleur has a maximum low cog tooth count, a minimum high cog tooth count, and total capacity they're spec'd for. Exceeding these specs dramatically will lead to poor or incomplete shifting. For example, one shouldn't place a short cage, 7 speed, road derailleur in a 9 speed mountain drivetrain with a triple front chain set and wide range, 11-34 cassette, and expect perfect shifting throughout the range. The drivetrain it's being thrown into, despite being a "compatible" 9 speed mountain, far exceeds the spec'd limits of the derailleur. It would likely fail to climb the chain on to the 1 or 2 largest cog's of the cassette. The chain would be noticably slack when on the front little ring and midway through the cassette since the short cage has not enough chainwrap capacity.