The Royals have won seven of their last eight games, taking three of four from Houston at home last week before sweeping the Chicago Cubs this past weekend.
"We're building off of yesterday and each day we just take something positive that we've been doing,'' manager Mike Matheny said.
Perez has 81 RBIs this season, which leads the team and is a career best, eclipsing the 80 he had in both 2017 and 2018. He got back on track against the AL West leaders after going 0 for 5 on Sunday.
Merrifield had an RBI double in the seventh inning and drove in two more with a triple in Kansas City's three-run eighth.
Kansas City rookie starter Daniel Lynch (4-3) yielded six hits and one run with three walks in five innings for his third straight win.
"We had good at-bats, but it always starts with starting pitching and Daniel was fantastic,'' Matheny said.
Houston manager Dusty Baker is disappointed his team has dropped four of five in the season series against a team with a losing record.
"They're hot and feeling pretty good about themselves,'' he said. "It doesn't matter if it's the softer part of the schedule as far as everybody is concerned. They don't feel like the softer part of the schedule.''
The Royals got a double from Ryan O'Hearn in the second and took a 1-0 lead when he scored on a ground-rule double by Emmanuel Rivera with two outs.
The homer by Perez off Zack Greinke (11-4) came in the third to make it 2-0.
Taylor Jones singled and Martin Maldonado walked to start the Houston third. Michael Brantley grounded into a force out before Yuli Gurriel doubled to score Jones and cut the lead to 2-1.
The Astros loaded the bases with two outs in the fifth, but Yordan Alvarez grounded out.
"(Lynch) seemed to just really make quality pitches in counts where a lot of pitchers aren't going to be able to execute,'' Matheny said. "Just a really impressive mix.''
Greinke permitted six hits and two runs in six innings.
Yimi Garcia took over for him and walked Michael A. Taylor to start the seventh before Rivera singled. Merrifield doubled on a grounder down the third-base line just out of the reach of a diving Aledmys Diaz to score Taylor and make it 3-1.
Perez hit a grounder to Garcia, but his throw home sailed over catcher Martin Maldonado's head for an error that allowed Rivera to score. Perez initially advanced to second on the play and was called safe, but the Astros challenged the ruling and it was overturned after a replay review.
The Astros scored 27 runs combined in wins over Seattle on Friday and Saturday but have struggled to take advantage of scoring opportunities in their last two games. They went 3 for 16 with runners in scoring position in a 6-3 loss to the Mariners in 11 innings Sunday and were 1 for 9 in those situations Monday.
Houston certainly isn't happy with its recent results against the Royals, but the Astros remained 3 1/2 games ahead of second-place Oakland and are trying to keep things in perspective.
"I don't think it's a huge deal,'' Gurriel said through a translator. "It's better that we have a bad stretch now than at the end of the season.''
Royals: 1B Carlos Santana exited in the ninth after he was injured running to first base on a force out. Matheny said Santana has a Grade 1 hip strain and is day to day. ... RHP Kyle Zimmer was activated from the injured list after missing about three weeks with neck spasms. ... LHP Jake Brentz was placed on the injured list with a left shoulder injury.
Astros: OF Chas McCormick was out of the lineup for a third straight game because of soreness in his left hand. ... 3B Alex Bregman (strained left quadriceps) had three hits for Triple-A Sugar Land in a rehab game. He will return to Houston on Tuesday to be evaluated before the team determines if he's ready to be activated. ... RHP Jose Urquidy (right shoulder discomfort) will make a rehabilitation start for Sugar Land on Tuesday night.
It was Merrifield's 36th multi-hit game, tied with Perez for most on the team.
Kansas City's Brady Singer (3-8, 5.23 ERA) opposes Luis Garcia (9-6, 3.39) when the series continues Tuesday night.