Australia were on course for a series-levelling win in the second Test after another below-par batting performance from India undid the good work done by their bowlers on day four at the Perth Stadium on Monday.
Chasing a target of 287 runs on a testing surface, India were 112 for five at stumps with skipper Virat Kohli's (17) dismissal in the 20th over of the second innings dealing a massive blow to the away team's hopes.
The last specialist pair of Hanuma Vihari (24) and Rishabh Pant (9) were in the middle when stumps were drawn and they will have to bat well in the first session on day five for India to have any chance of scoring the remaining 175 runs.
The ordinary batting effort came after a sensational performance from pacer Mohammed Shami, who took a career best six for 56 in Australia's second innings to bring India back into the contest.
Shami removed the set Usman Khawaja (72) and Tim Paine (37) to trigger a batting collapse that saw Australia being all out for 243 after the duo batted out the entire morning session.
At tea, India were reeling at 15 for two and following the break it got worse for the visitors as they lost wickets in a bunch. Murali Vijay (20) and Virat Kohli (17) added 35 runs for the third wicket before things went into a downward spiral.
Kohli was the first to go, with Lyon inducing him forward and the batsman edged it to slip as the Australian players broke into celebration.
Two overs later, Lyon (2-30) got an off break to jump off the rough and Vijay was bowled going for a drive as India were reduced to 55-4.
Ajinkya Rahane (30) came out playing his shots and took on the bowling with two fours as well as a six. He put on 43 runs for the fifth wicket with Vihari as India started thinking of at least taking the fight into day five.
But it was not to be, as Rahane hit a drive straight to point off Josh Hazlewood (2-24) and India plunged to 98-5.
Before tea, KL Rahul (duck) played another indecisive stroke and was bowled off Starc on the fourth ball of the second innings. The bigger moment came when Hazlewood had Cheteshwar Pujara (4) caught behind off a faint edge in the fourth over to leave India leaning on Kohli once again.
This was after a fiery spell from Shami brought India back into the game. With his stellar effort, Shami surpassed Anil Kumble's record of most wickets taken by an Indian bowler in away Tests during a calendar year. Shami has taken 42 wickets to Kumble's 41.
Post lunch, Australia collapsed in a heap as they lost five wickets for 15 runs in the space of eight overs.
Shami was the wrecker-in-chief, taking 4-26 after lunch, as his express pace combined with short stuff bamboozled the Australian lower order.
Skipper Paine was the first go, unable to negotiate sharp bounce and gloving to Kohli at second slip.
Fit-to-bat Aaron Finch (25) came out to bat next, but lasted only one ball, clipping down leg side and caught behind. Shami was on a hat trick for the second consecutive Test, but missed out.
An over later though, using the second new ball, he got rid of Khawaja with another sharp rising delivery to pick his fourth five-wicket haul in Test cricket.
Eight balls later, Jasprit Bumrah (3-39) got rid of Pat Cummins (1), bowled off a delivery keeping too low.
Lyon (5) hit out and took Australia past 200, but Shami knocked him over in similar fashion to the rest as he picked his best figures in Test cricket. His previous best was five for 28 against South Africa in Johannesburg in January 2018.
The last wicket pairing of Mitchell Starc (14) and Josh Hazlewood (17 not out) frustrated the Indian team though, and added 36 golden runs for the 10th wicket, taking the lead past 280.
In the morning session, Paine and Khawaja had continued their overnight fifth wicket as Australia reached 190-4 at lunch. Starting from overnight 132-4, the two batsmen negotiated the first hour in a sedate manner. They didn't look in any rush as only 19 runs came forth.
Bumrah was pick of the bowlers once again, getting the ball to rear up from length and beating the batsmen on many occasions, in particular Khawaja. But the outside edge continued to elude him.
The duo stepped up on the scoring rate a bit more in the second hour of play, and added another 39 runs to the total.
Indian skipper Virat Kohli and Paine were once again involved in a verbal exchange, with umpire Chris Gaffaney stepping in to ask the duo to get on with the game.
Australia had scored 326 runs in their first innings, and India replied with 283 runs, thanks to Virat Kohli's 25th Test hundred, thus conceding a lead of 43 runs.