Bruce Arena's men came from 3-1 down at half-time at Colorado's Dick's Sporting Goods Park as Landon Donovan scored an 80th-minute winner.
The Galaxy sit fourth in the Western Conference, while the Rapids are seventh after their fifth straight loss.
Colorado looked on track to end their losing run when they went 2-0 up inside 18 minutes.
Marlon Hairston made it 1-0 when he put away a rebound after Galaxy goalkeeper Jaime Penedo did well to save a Deshorn Brown effort.
Edson Buddle scored his 100th MLS goal to double the lead as he headed in a corner against his former team.
Robbie Keane produced a much-needed response for the Galaxy in the 20th minute with a smart header into the bottom corner from Dan Gargan's floated cross.
The Rapids had their two-goal lead back on the half-hour mark, when Marc Burch's powerful free-kick from 30 yards went in off the crossbar.
Omar Gonzalez gave LA hope when he headed in a Donovan free-kick in the 55th minute.
Alan Gordon tucked away the equaliser in the 68th minute before Donovan scored what proved to be the winner.
Keane played in Donovan, who rounded the onrushing Clinton Irwin before finishing into an open goal.
In the day's other game, the Seattle Sounders were held to a 1-1 draw by the San Jose Earthquakes.
Chad Barrett's 46th-minute opener had the Sounders, second in the West, on track before Chris Wondolowski's equaliser.
Seattle are level on points with conference leaders Real Salt Lake, while the Earthquakes sit eighth.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.