The Swiss, ranked 17 in the world, dropped the first set before prevailing 4-6 6-2 6-1 against the Slovenian to set up a last-eight meeting with Guillermo Garcia-Lopez.
Wawrinka won five of 10 break point chances and fired down seven aces during the match, which lasted just over an hour and a half.
Spaniard Garcia-Lopez downed Edouard Roger-Vasselin of France 6-7(4) 7-6(3) 6-2 to ensure his progress in a duel that lasted two hours and 52 minutes.
Wawrinka and Garcia-Lopez have met four times previously, with both men having won twice.
Fourth seed Benoit Paire of France also moved through in three sets, recovering from a set down to beat Slovenian Aljaz Bedene 4-6 6-4 6-3 and set up a clash with Tommy Robredo, who saw off Tobias Kamke of Germany 6-4 7-5.
Earlier, Robin Haase made it through to the second round with a 6-3 2-6 7-5 win over Roberto Bautista of Spain.
"I am trying to play better and better,” Haase said. “I have started working with a new coach and already, I feel I am improving. But you cannot change dramatically after 15 years of playing.
"I made a good start here by winning my first-round match. Of course, I need to raise my level if I want to keep on winning.”
Casablanca Open results
Tommy Robredo (Spain) beat Tobias Kamke (Germany) 6-4 7-5
4-Benoit Paire (France) beat Aljaz Bedene (Slovenia) 4-6 6-4 6-3
Guillermo Garcia-Lopez (Spain) beat Edouard Roger-Vasselin (France) 6-7(4) 7-6(3) 6-2
1-Stanislas Wawrinka (Switzerland) beat Blaz Kavcic (Slovenia) 4-6 6-2 6-1
7-Robin Haase (Netherlands) beat Roberto Bautista (Spain) 6-3 2-6 7-5
Kenny De Schepper (France) beat Steve Darcis (Belgium) 6-3 6-4