It's always been my understanding that the SP had to record 15 outs to qualify for the win. If he fails to do that, but leaves the game with a lead that is never relinquished, the win goes to the "most effective reliever". In other words, if the SP goes 4 2/3 and leaves with a 10-0 lead, the most effective reliever would get the win if the score ended at 10-9. If it was 11-10, the reliever pitching at the time of the 11th run would get the win.
Edit: Not sure how rain-shortened games work. I'm sure someone would show up to question/correct that.