With leading scorer Lionel Messi suspended for the first time in his career, the champions lacked a cutting edge until Andres Iniesta fired them in front just before halftime at the Nou Camp.
The game was turned on its head a minute into the second half when home defender Gerard Pique was shown a harsh red card as he got in a tangled with Miguel de las Cuevas on the edge of the Barca area.
Almost immediately substitute David Barral stole in front of keeper Victor Valdes to nudge in the equaliser for second from bottom Sporting.
The magnificent Iniesta drove Barca forward in search of the winner and it was Keita who struck the decisive goal with a stunning shot into the top corner.
Iniesta then set up Xavi for the third goal at the end as Barca closed the gap on leaders Real Madrid to seven points until Jose Mourinho’s side host Espanyol at the Bernabeu on Sunday.
Real have 64 points and second-placed Barca 57. Malaga moved up into fourth on 37 points earlier in the day.
Manuel Pellegrini’s side climbed into the Champions League qualification places with a 3-1 comeback win at Getafe courtesy of three spectacular long-range strikes.
Portugal’s Eliseu fired Malaga level after 57 minutes, France midfielder Jeremy Toulalan crashed a second in off the post and Spain’s Santi Cazorla caught out the home keeper from just over the halfway line with a wonderful lob in stoppage time.
Rayo Vallecano came back from 2-0 down to beat 10-man Racing Santander 4-2 while Real Mallorca drew 1-1 at home to Osasuna.
(For more sports news and updates, follow Ahram Online Sports on Twitter: @AO Sports)