Stevens has not beaten Williams since a 5-1 success in the last eight of the British Open a decade ago, but he will wonder how this match eluded him having led 3-0 and 4-1.
Stevens missed easy browns that would paved the way for leads of 4-0 and 5-1 at London's Alexandra Palace, but instead proved to be confidence-draining moments as Williams, who struggled badly himself for large swathes of the afternoon, won five straight frames to reach the quarter-finals.
Williams will meet Mark Selby or Stuart Bingham in the last eight on Friday night. They conclude the first round matches later on Wednesday.
"Every time we play really, it doesn't seem to be the best of matches," said Stevens. "It shows how much a match can turn on its head after I missed the brown to go 5-1 ahead. It is funny how things can just turn on one ball. We both struggled. Mark couldn't make a 10 break, but then started to hit the ball a bit better.
If I don't laugh (about the defeat), I will cry. It is only a snooker match at the end of the day."
Stevens won this tournament in 2000 with Williams claiming the trophy in 1998 and 2003, but both men were notable only for their wastefulness. "Matthew missed the brown to lead 5-1, and that would have been match over," said Williams.
"We both struggled today, but I probably struggled more than Matthew in the first half of the match. I stuck in there and tried as hard as I could. I never gave up even though I was 4-1 down. When you are sitting in the corner 4-1 down and can't get anything going, you just want to find a little hole and crawl into it.
"I hope this is a turning point for me, but I will have to play a lot better. I'll be 38 next month. It is going to be hard for me to win a tournament as I get older, but I think there are more wins in me. I'm playing brilliant in practice, but I have to bring it to the match table."
Stevens pinched the first frame on the black, and the second on the pink with Williams lacking any real confidence among the balls. Stevens had failed to benefit from copious amounts of openings yet found himself two frames clear mainly due to the error-strewn efforts of his fellow Welshman, who looked far from his best despite contributing 41 and 52. The third frame fell in favour of Stevens as a 55 was the dominant influence with Williams again found wanting among the balls.
Williams broke down on 55 in the fourth frame, but watched as Stevens missed the final brown when he seemed certain to ease 4-0 ahead.
Williams looked almost embarrassed as he picked off brown, blue and pink to trail 3-1.
The lead moved to 4-1 courtesy of a 67 from Stevens before a 59 left the former world championship finalist apparently set to move four up with a possible five to play.
Williams could only make 37 in response, but remained alive in the frame until the colours.
Williams missed a brown down the side cushion with the rest at pace only for Stevens to astonishingly blow a straight brown that would have left Williams needing snookers.
Williams potted brown, blue, pink and black in being handed his second frame of the afternoon.
Both men continued the pattern of missing easy balls in the seventh frame, but Williams finally ran into some of his old form as 59 saw him win a second straight frame to trail 4-3.
Stevens pieced together 48 in the eighth frame, but an awful miscue trying to hit the final red bridging over the black handed Williams the chance to clear to level at 4-4.
Stevens continued in a state of torpor as another wretched miss on a red to a middle pocket presented Williams with the chance to run in 68 for a 5-4 advantage.
Williams made 48 in the tenth frame after Stevens jawed a black before he returned to sink a long red and enough points to secure a fifth straight frame.
It was an incredible recovery mounted on a healthy dose of mediocrity with Stevens looking rightly stunned.