The Galaxy (16-15-3) fell to fifth in the Western Conference standings and will play at No. 4 seed Minnesota in the knockout round.
Ramirez put away a first-timer, off a feed from Alberth Elis, from the center of the area to give Houston (12-18-4) a 3-2 lead in the 83rd minute.
Zlatan Ibrahimovic chipped in from 17 yards out to give LA a 1-0 lead in the ninth. Sebastian Lletget rolled a pass to Ibrahimovic who paused and then, with the defense sagging, lofted a side-netter over the out-stretched arms of goalkeeper Tyler Deric.
Ramirez tied it in the second minute of first-half stoppage time. Elis, on a breakaway, bounced a shot off the post and Ramirez put away the rebound.
Cristian Pavón first-timed a pass from Uriel Antuna into the side net to give the Galaxy a 2-1 lead in the 54th minute but Elis tied it in the 62nd.