Glamorgan resumed on a sunny morning at Cardiff and were finally all out for 355. Chris Woakes took the last five wickets to record figures of 5-59 off 26 overs as the home side set Warwicks a total of 183 to win.
Warwicks lost Navdeep Poonia for 17 and with the score on 110, acting skipper Ian Westwood, who had made 176 in the first innings, was out for 58 lbw to Dairyimple.
Michael Powell was out for 55 with only twenty four required and then a run later, Jon Trott was out for 23 caught by David Hemp.
Tony Frost was the fiftth batsman to lose his wicket when he was dismissed with the score on 167.
With five overs left, Jim Troughton decided that he was wasting valuable drinking time and hit Robert Croft for a four and two sixes in three balls to give Warwickshire a win by five wickets.
Warwickshire who now top the table by 16 points play Glamorgan in a Twenty/20 game on Wednesday (7pm start). England internationals Tim Ambrose and Ian Bell will be available for the game.
If Warwicks were to win the Twenty/20 Cup then they would qualify for the new Champions League and a possible £2.5m pay out.