The 31-year-old Keita, a fringe player this season, scored the decisive goal on 43 minutes as Barcelona made it three league wins in the space of eight days and piled the pressure on Real who travel to Racing Santander on Sunday.
It was a far from vintage performance, but three points and another clean sheet are the perfect preparation for Barcelona's Champions League second leg showdown with Arsenal on Tuesday as Barca bid to overturn a 2-1 deficit.
Real Madrid are in action on Sunday when they travel to Racing Santander, looking to improve their erratic away form, but they must do so without top-scorer Cristiano Ronado who is missing with a thigh muscle strain.
With the Arsenal game in three days time, Barca coach Pep Guardiola rested Spanish stars David Villa and Andres Iniesta allowing Keita and Bojan Krkic a chance to shine.
Goalkeeper Victor Valdes also returned between the sticks after missing the last three league matches with a knee injury so Jose Manuel Pinto dropped to the bench.
Barca were almost given a shock in the eighth minute with Gerard Pique called upon to make a decisive late tackle as Nicolas Bertolo was about to shoot on goal.
The hosts had their first real effort in the 18th minute with Pedro Rodriguez's low shot tipped wide of the post after the home side had worked a training ground corner routine.
Minutes later Bojan's deflected shot clipped the bar and Keita had a header ruled out for a marginal offside.
Keita scored again on 43 minutes and this time the goal stood. Lionel Messi showed his trademark close control to get behind two Zaragoza defenders and cut the ball back from the right touch-line and the ball fell kindly for Keita to stroke home only his second league goal of the season.
Zaragoza, two points above the relegation zone, almost levelled early in the second half with Bertolo going past Pique but his curling effort crept inches past the post.
Pique had a header saved on the goal line before Florent Sinama Pongolle missed a glorious chance to equalise with an outstretched foot from Valdes denying the Frenchman.
Substitute Villa should have scored a second for Barca on 73 minutes but the striker blazed over after Maxwell's shot had been parried by Antonio Doblas but it didn't matter as the hosts saw out the game.
Earlier Spanish international winger Pablo Hernandez scored twice as Valencia came from behind to win 2-1 at Real Mallorca on Saturday to move four points clear of fourth-placed Villarreal.
Hernandez, 25, scored in each half as Valencia bounced back from their midweek 1-0 home defeat to Barcelona with their eighth away win of the season to strengthen their position in third.
Islanders Mallorca took a 31st minute lead with centre-back Ivan Ramis converting a penalty after Ricardo Costa fouled Cameroon striker Pierre Webo.
The lead was short-lived, however, as Valencia equalised 60 seconds later collecting a knock down from Aritz Aduriz before drilling in a shot from outside the box.
Valencia struck again on 56 minutes with Brazilian Jonas Oliveira feeding Hernandez to grab his second goal.
Valencia travel to Schalke on Wednesday for the return leg of their last 16 Champions League tie with the score evenly poised at 1-1 from the first leg.
Fourth-placed Villarreal travel to Atletico Madrid later on Saturday bidding to close the four point gap on Valencia.
Villarreal have won a miserly four games on the road and their coach Juan Carlos Garrido is suspended from the dug-out and must watch from the stands at the Vicente Calderon.