The third baseman scored from first on a double in the 11th inning, then drove in the winning run with a single over a drawn-in outfield in the 14th to carry the Cubs to a 4-3 victory over the Arizona Diamondbacks in a game delayed 3 hours 4 minutes by rain.
"This is the kind of thing you know Aramis is capable of."
With two out and the Cubs down 3-1 in the 11th, Ramirez reached on a single after an Eric Karros hit.
Pinch-hitter Troy O'Leary then lashed a line drive to the wall in left-center field.
Ramirez was waved home by third-base coach Wendell Kim.
But he was going whether he had the green light or not.
"There were two outs and I have to take my chances," Ramirez said.
"I got it in my mind to score because we probably wouldn't have too many chances after that."
Ramirez beat the tag with a head-first slide that saved the Cubs after Arizona had gone up 3-1 in the top of the 11th.
In the 14th, Sammy Sosa and Moises Alou singled ahead of a walk to Karros with one out. Ramirez then worked the count to 2-2 against reliever Eddie Oropesa and, with the infield and outfield in, lifted a deep fly ball that went off the glove of right fielder Raul Mondesi and sent what was left of a crowd of 38,738 home happy.
"I just tried to make contact there," Ramirez said. "You just don't want to strike out."
Ramirez's performance was one of several that helped the Cubs keep pace with Houston. They trail the first-place Astros by 3½ games in the NL Central.
Reliever Antonio Alfonseca pitched three innings to pick up his first victory of the season.
He also managed to lay down the first sacrifice bunt of his major-league career along the way.
Lenny Harris provided the Cubs their first run when he defied Mondesi's arm on a fly to short right in the sixth. Harris led off with a single pinch-hitting for starter Juan Cruz. Kenny Lofton sacrificed him to second and he moved to third on Mark Grudzielanek's infield single.
Sosa lifted a fly to short right that Mondesi took without getting himself into perfect throwing position. Harris broke on the catch and scored easily when Mondesi's throw went up the line and the relay went past catcher Rod Barajas, tying the score at 1-1.
The Diamondbacks spent much of Friday's early evening squandering scoring opportunities.
They left men on in scoring position in the sixth, eighth, ninth and 10th innings before opening the 11th with singles by Steve Finley and Mondesi off Joe Borowski. Mondesi then stole second uncontested.
Borowski retired Alex Citron on a grounder to a drawn-in infield for the first out but Barajas looped a single to short right to score two.
The Cubs were able to answer with O'Leary's double.
"It was kind of like a playoff-game atmosphere," Baker said.
"If it takes all night to win, then that's what you have to do."