Osaka, the fourth seed, got past Sevastova 4-6 6-3 6-4 despite an indifferent performance in the fourth round on Rod Laver Arena.
The US Open champion was below her best for long periods, but lifted at the right moments to advance.
Osaka moved into a quarter-final showdown against sixth seed Elina Svitolina – her first last-eight appearance in Melbourne.
Sevastova – the 13th seed who was eyeing a fourth grand slam quarter-final – looked bright early and broke for a 2-1 lead, a blow that would be decisive for the set.
Osaka, pushed to three sets by Hsieh Su-wei in the third round, seemed flat and tight, making 17 unforced errors in the opener.
Looking for a lift, Osaka started to improve and was rewarded with a break in the sixth game of the second set, a forehand winner giving the Japanese star a 4-2 lead.
Osaka saved a break point in the ninth game after an incredible 23-shot rally on her way to winning the second set.
She took a break lead in the third set, but gave that up after a lengthy sixth game.
However, Osaka broke again for 4-3 and convincingly saw out her win, a forehand winner down the line sealing victory.