Nineteen-year-old paceman Nathan Buck did most of the damage for the visitors by firing out the first three home batsmen in his first two overs with the new ball.
Although Yorkshire never quite recovered from this early setback, the result was in doubt right to the final ball which Richard Pyrah needed to hit for six to tie the match.
It was delivered by Leicestershire captain and former Yorkshire and England paceman Matthew Hoggard, and Pyrah lashed it but was calmly caught by James Benning.
Yorkshire ended on 169-8 as they chased a 176 target and the man of the match was Leicestershire batsman James Taylor, who got his side out of trouble with a sparkling unbeaten 62 from 28 balls with three fours and four sixes.
Read Chris Waters in Monday's Yorkshire Post.