Substitute Timo Werner scored one and set up another in the second half to cancel Naldo's equalizer as Leipzig moved a point above Schalke, and 13 behind leader Bayern Munich.
Schalke goalkeeper Ralf Faehrmann saved a penalty from Jean-Kevin Augustin but there was little he could do to stop Keita's effort from distance after it took a decisive deflection from defender Naldo about five minutes before the break.
Keita is due to leave Leipzig for Liverpool at the end of the season, but media reports suggest the English club is interested in bringing forward the transfer.
Speaking before the game, however, Leipzig sporting director Ralf Rangnick said there had been no contact from Liverpool about changing the existing agreement, reported to worth some 70 million euros ($85 million).
"There are no inquiries or offers for any player who is on the pitch on or the bench for us today from any club," said Rangnick, who added that an increased offer would make no difference.
Keita was booked in the second half, his fifth yellow card of the season ensuring he'll be suspended for the following game. He might have got another for a foul on Max Meyer before Leipzig coach Ralph Hasenhuettl decided to take him off with just over 20 minutes remaining.
Naldo equalized early in the second half when he was left unmarked to head in a free kick, but Werner put the home side back in front after coming on with half an hour remaining, then set up Bruma to seal the win.
GOMEZ'S DECISIVE RETURN
Mario Gomez celebrated his return to Stuttgart with a hand in the side's late goal to beat visiting Hertha Berlin 1-0.
The Germany striker was being held by Hertha defender Niklas Stark and appealed for a penalty when they both fell over, only for the ball to come off Stark and loop over his own goalkeeper. Referee Felix Brych allowed the goal to stand.
Gomez was playing his first competitive game for Stuttgart since rejoining the side in a winter transfer from Wolfsburg. The 32-year-old Gomez's career began with Stuttgart youth sides before he helped the senior side win the Bundesliga in 2007.
Stuttgart climbed away from the relegation zone and was just four points behind Hertha in mid-table.
"We didn't play the stars out of the sky but it was an important win for us," said Stuttgart coach Hannes Wolf, who acknowledged Hertha was the better side.
Hertha had 10 efforts on goal compared to the home side's seven.
HANNOVER'S HAT TRICK HERO
Niclas Fuellkrug scored a hat trick as Hannover came from two goals down at home to beat Mainz 3-2 and move two points above Hertha.
Augsburg defeated Hamburger SV 1-0 to leave the visitor stuck in the relegation zone.
Eintracht Frankfurt and Werder Bremen were held to 1-1 draws at home by Freiburg and Hoffenheim, respectively.
Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.