Harper was hit by Dellin Betances with an 89 mph slider with no outs in the top of the inning. After taking a few steps toward first base, Harper trotted back to the dugout and did not return to the game. He was replaced by Brian Goodwin.
Manager Dave Martinez said Harper left the game for precautionary reasons and that he is expected to be back in the lineup Wednesday.
Earlier Tuesday, Harper was hit on his right elbow by a 90 mph pitch from CC Sabathia in the fifth inning and fell to the ground.
"I feel fine. Elbow feels OK, and the big toe just hurts a little bit,'' Harper said. "I already got an X-ray on the toe. I'm fine."
Harper, who leads the NL with 19 homers but is hitting .215 since May 1, had been hit by a pitch just once previously this season and had not been dinged twice in a game since Aug. 16, 2013, at Atlanta.
"Kind of worried me when he started walking off the field,'' Martinez said.
A free-agent-to-be, Harper had walked in his first two plate appearances.
"It just hurt, so trying to walk down the first-base line, there was no point,'' he said. "No ill feelings at all.''
The Associated Press contributed to this report.