That duo combined to help beat the team that's been playing as well lately as any in major league baseball.
Thompson pitched 4 1/3 scoreless innings in his big league debut and Grilli won for the first time in nearly two years as four Pittsburgh pitchers combined on a five-hitter in the Pirates' 2-0 win against the Milwaukee Brewers.
The NL-Central leading Brewers lost for just the fifth time in their last 29 games.
Thompson allowed four hits while walking two and striking out one. He was on a pitch count after throwing just four innings in each of his previous two minor league starts.
"I was a little nervous but it wasn't too bad," Thompson said. "I got here (Tuesday) so I had a chance to get used to the clubhouse and the ballpark. I was around most of the guys in spring training and they reached out and made me feel welcome. So the nerves weren't as bad as they might have been."
Hanrahan notched his 32nd save in 35 opportunities by striking out the side to work out of a jam. He had lost in his two previous appearances, both against the Cincinnati Reds.
Thompson, 24, had his contract purchased from Triple-A Indianapolis before the game. He was needed to fill in for All-Star right-hander Kevin Correia, who went on the disabled list Monday with a strained oblique muscle.
A first-round draft pick of the Florida Marlins in 2004, the left-handed Thompson was claimed off waivers by the Pirates from the Washington Nationals last December. He went 1-0 with a 0.77 ERA in three games, two of them starts, for Indianapolis after spending most of the season at Double-A Altoona, where he was 4-7 with a 5.16 ERA in 28 games, including 12 starts.
"Poise is the word I kept using over and over in the dugout to describe Aaron," Pittsburgh manager Clint Hurdle said. "He had a slow heartbeat. He looked polished out there, like he had done it a number of times. He stepped into a difficult situation against a really good team and did well. We're proud of him."
Grilli earned his first win since Aug. 27, 2009, when he was pitching for the Texas Rangers against the New York Yankees. He missed all last season after undergoing reconstructive knee surgery in spring training and pitched this season with the Philadelphia Phillies' Triple-A Lehigh Valley farm club before being granted his release and signing with the Pirates on July 21.
"I'm just thankful for the opportunity to be pitching in the major leagues again," Grilli said. "I don't like to think back to when I got hurt last spring but I really wondered if I'd ever play again. I put in a lot of hard work, with a lot of support from my family, and I've made it back.
"It's nice to get a win again but I'd gladly give it to Aaron," Grilli added. "It's his day, a day he'll never forget."
Shaun Marcum (11-4) lost for the first time in eight starts since the All-Star break, as he gave up two runs and four hits in six innings. He walked three and struck out four.
"He grinded," Brewers manager Ron Roenicke said. "He does a great job when he doesn't have his great command and still figures how to get out of innings."
Ryan Braun had two hits for Milwaukee.
The Brewers threatened in the ninth against Hanrahan. Braun hit a leadoff single and Prince Fielder walked. Hanrahan, though, rebounded to strike out Casey McGehee, Yuniesky Betancourt and Jonathan Lucroy.
"We had a few chances but we couldn't get the run across and some of the credit has to go to the Pirates' bullpen," Milwaukee second baseman Josh Wilson said. "The bullpen shut us down."
Pittsburgh placed left fielder Ryan Ludwick on the 15-day DL before the game with back spasms, creating a roster opening for Thompson. ... Milwaukee left-hander Chris Narveson, who beat the Pirates on Monday night, will not start again until Sept. 3 at Houston because of off days in the schedule Thursday and next Monday. Narveson will work in relief until then, a role he may assume if Milwaukee reaches the postseason -- it has no left-handers in the bullpen. ... Brewers outfielder Carlos Gomez, who has been on the disabled list since July 21 with a broken left clavicle, will be examined by team doctors Friday. If cleared, Gomez will begin a rehab assignment with Class A Wisconsin on Saturday and be activated Sept. 1 when the roster limit expands from 25 to 40. ... Pirates infielder Chase d'Arnaud (broken right pinkie finger) and outfielder Alex Presley (bruised left hand) have been deemed ready to return from their rehab assignments at Indianapolis but will remain in the minor leagues for now because Pittsburgh does not have room on its roster for either player. ... The Pirates pitched their 10th shutout and the Brewers were blanked for the 11th time. ... The Pirates open a four-game series at St. Louis on Thursday night as Charlie Morton (9-6, 3.42 ERA) pitches against the Cardinals' Edwin Jackson (2-2, 4.45). Morton is 6-1 with a 1.98 ERA in 11 starts against NL Central teams. Cardinals infielder/outfielder Skip Schumaker is 9-for-17 (.538) lifetime against Morton, and right fielder Lance Berkman is 5-for-10 (.500) with two home runs. Jackson is 2-0 with a 3.79 ERA against Pittsburgh in three career starts. ... Milwaukee begins a six-game homestand Friday night with the opener of a three-game series against the Chicago Cubs.