Spurs were without 10 players but held on despite a second-half collapse to set up a two-legged semi-final against Liverpool.