Atalanta are two points behind second-placed AC Milan who beat Genoa 2-1 thanks to an own-goal from Gianluca Scamacca to claim their first win at the San Siro in over two months.
Juventus were playing without injured star striker Cristiano Ronaldo in the match between the Champions League rivals in Bergamo. Substitute Malinovskyi broke the deadlock three minutes from time with a goal which took a deflection off Alex Sandro to send Juve goalkeeper Wojciech Szczesny the wrong way.
Juve's nine-year reign as champions looks set to end, and they are now face a battle for a Champions League place. They sit fourth and risk being overtaken by fifth-placed Napoli who play leaders Inter Milan later Sunday.
Atalanta had not beaten Juventus in Serie A in 20 years going back to February 2001. In Ronaldo's absence, Paulo Dybala got his first start in over three months after recovering from a knee injury. But the Argentine failed to make much of an impact and was substituted in the 68th minute despite setting up Weston McKennie for a chance the American missed on 38 minutes and sending a free-kick wide after the hour mark.
Alvaro Morata missed two chances to break through, the first cleared off the line in the 34th minute by Berat Djimsiti following a Federico Chiesa cross and the other saved by Pierluigi Gollini with 14 minutes remaining. To add to Juventus coach Andrea Pirlo's woes forward Chiesa limped off after an hour.
Top Atalanta striker Luis Muriel fired over the bar after an hour with Duvan Zapata heading wide after 70 minutes. Malinovskyi came off the bench with quarter of an hour to go and proved decisive.
His long-range free-kick was parried by Szczesny before he beat the Polish keeper to hand Atalanta a fifth consecutive win and boost confidence before meeting Juve in next month's Italian Cup final.
Standout matches today