Devvarman stunned the 24th seed with a wide variety of shots and took the first set after a marathon tie-break which continued for 22 gruelling points.
Janowicz struggled to establish his game in the second and was soon in big trouble as Deccarman secured a two-set advantage.
Roared on by a small but vocal section of Polish support, Janowicz dug deep to hang on in the third, using a huge serve and powerful forehand to reduce the deficit.
Janowicz had all the momentum in the fourth set, levelling the match in just 34 minutes as Devvarman called for a medical timeout.
The Indian underdog fell 5-2 behind in the decider but broke back to make Janowicz close out the match on serve.
Devvarman looked dead and buried but won two timely games before Janowicz needed a timeout of his own as he suffered with blisters on his left arm.
A topsy-turvy tussle went deep into the fifth but it was Janowicz who kept his debut run in Melbourne alive with a late flurry to round off an entertaining encounter.