Pena, who had only two at-bats in August, didn't enter the game until the eighth inning as a pinch runner. He snapped an 0-for-17 drought with a one-out single in the 10th, then followed Teahen's double with another base hit in the 12th.
"That's the first time that [a walk off hit] ever happened to me," Pena said. "That's just a great feeling. All the guys are on top of you, jumping on you and punching you. That's the only time I think when you get punched it doesn't hurt. This is definitely a confidence booster, especially having not played that much."
The Twins walked Jose Guillen intentionally to face Pena, who is hitting .157.
"I figured they were going to do that," Pena said. "He's a power hitter, so I just tried to make them pay and it worked out."
Pena's hits were his first since July 19 and it was his first multihit game since July 3.
"He was due," Royals manager Trey Hillman said. "I knew he was at least going to going to get up there and battle. I think he might have half-expected I was going to pinch hit for him."
The Royals snapped a four-game losing streak and won for only the second time in nine home games this season against the Twins, who dropped a half-game back of the Chicago White Sox in the AL Central.
The Royals took advantage of two errors and a wild pitch to score three of their first four runs and the Twins blew a 4-2 lead in the eighth.
"The easiest way to describe that game was we gave it away," Twins manager Ron Gardenhire said. "Early in the game, late in the game, it was probably as bad a defense as you can play. The first two runs they got was ridiculous -- a chopper back to the mound and we're not covering first base.
"We missed opportunities to score, but still, if we catch the ball and get the outs we're supposed to get that's a 'W,' not a loss."
Scott Baker, who is 5-1 in his past 10 starts, held the Royals to seven hits and two runs, with one walk and seven strikeouts in seven innings.
Gil Meche, who was 4-0 with a 1.71 ERA in his first four starts since the All-Star break, gave up four runs in 6 1/3 innings. While he limited the Twins to five hits, he also walked seven batters, one shy of his career high.
The Royals took advantage of a wild pitch from Dennys Reyes and Everett's throwing error to tie it in the eighth. Teahen, who led off the inning with an infield single, came home on Reyes' wild pitch and Everett's error with two out allowed pinch runner Pena to score.
"I just threw it away," Everett said. "You can slice it and dice it and word it anyway you want, but it cost us the game. You know we got [closer Joe] Nathan coming in right there and you know how well he's done this year, so I'll take that one for the team, for sure. It stinks, but that's the way it is."
The Royals grouped four singles in the sixth and took advantage of Baker's throwing error to score two runs. The errant toss to first base with no one covering the bag on Teahen's single allowed Mitch Maier to score from first. Teahen went to third on the error and scored on Guillen's single.
"It was just one of those funny plays," Baker said. "I went to throw to second and you know, I wasn't 100 percent sure that we had him there, and then I go to first and really I probably should have just ran all the way. But Teahen runs pretty well. I probably could have executed it a little better on my part, but it's just a case of 'there you are."
Teahen went 3-for-5 and scored three runs.
"The Twins pitch well, scratch out runs and play good defense," Teahen said. "That's how they win games. Today they made a few errors and the wild pitch and luckily we were able to do something with it when they made those mistakes."
Twins 2B Nick Punto struck out four times, matching a career high. He also struck out four times on July 21, 2006, at Cleveland. ... OF David DeJesus was held from the Royals lineup with a sore hip.