Pakistan will need 261 to qualify for the April 2 World Cup final in Mumbai.
Sachin Tendulkar top scored for India with 85, falling 15 runs short of his 100th international century but holding India's innings together. Tendulkar survived six chances, including four dropped catches.
Riaz took two India wickets in two balls to drag Pakistan back into contention and finished with 5-46.
India dominated the early overs, when Virender Sehwag smacked 38 from 25 balls.
Score: India 260-9 after 50 overs (Tendulkar 85, Sehwag 38, Suresh Raina 36 not out; Wahab Riaz 5-46)