Ramirez hit a 1-2 pitch off rookie Robert Coello (0-1) that hit the outside corner of a yellow pad below the foul pole. Third base umpire Paul Nauert ruled it a foul ball. He agreed to check video replay after discussing the play with Milwaukee manager Ron Roenicke and third base coach Ed Sedar while watching a fan dramatically pound the pad in question.
Umpires spent about 90 seconds checking the replay, before returning and signalling a home run for Ramirez, his eighth of the year.
Kameron Loe (4-2) was credited with the win despite allowing Jose Bautista to hit a game-tying three-run home run in the top of the seventh. John Axford pitched the ninth for his 12th save in 15 chances.
The Blue Jays trailed 6-1 before rallying to tie the game.
Bautista's homer was his 20th. Brett Lawrie and Edwin Encarnacion also homered for Toronto, with Encarnacion's travelling an estimated 463 feet and landing on Bernie Brewer's slide in left field.
Ramirez also had a single and double, and finished with three RBIs for Milwaukee. Rickie Weeks had a pair of singles and two RBIs.
Lawrie, the Brewers first-round draft choice in the June 2008 free agent draft, made his Miller Park debut by hitting an 0-1 pitch from Milwaukee starter Randy Wolf for a homer to leadoff the game. Lawrie was traded to Toronto before the 2010 season for right-hander Shaun Marcum.
The Brewers made it 2-1 in the bottom of the first on a two-run single by Weeks off Toronto starter Henderson Alvarez.
Milwaukee took a 6-1 lead in the second on an RBI single by Norichika Aoki, an RBI ground out by Ryan Braun and a two-run double by Ramirez.
Toronto loaded the bases with no outs in the third against Wolf, but Encarnacion hit into a ground ball double play and the Blue Jays scored only one run to get within 6-2.
Encarnacion's 18th homer of the year pulled Toronto to 6-3 in the sixth.
In the seventh, Omar Vizquel led off with a single. Loe was summoned with one out to face Lawrie, and got a fielder's choice groundout. Colby Rasmus then walked and Bautista hit a 1-0 pitch into the left-field stands to tie the game at 6.
Alvarez continued to struggle, giving up six runs on 11 hits and two walks with one strikeout in four innings. In his last seven starts, the right-hander is 0-5 with a 6.29 ERA, allowing hitters to bat .350 (63-180).
Wolf pitched 6 1-3 innings, giving up four runs on eight hits and a walk while striking out six. It was the third consecutive game and fourth in five starts that he left the game with the lead and the bullpen gave it up.
Notes: Toronto RHP Kyle Drabek (4-7 with a 4.67 ERA in 13 starts) will undergo ulnar collateral ligament surgery on his pitching elbow Tuesday, the Blue Jays said. It will be the second time he has had the surgery. The first time was when he was in high school. . Marcum will miss his scheduled start Tuesday due to tightness in his right elbow. Marcum (5-3 with a 3.39 ERA in 13 starts) had ulnar collateral ligament surgery in 2008 when he pitched for Toronto. . Braun has a 13-game hitting streak