The Dens Park side pushed hard for an equaliser at Tynecastle Park after going two goals behind before Jason Cummings netted a penalty around the hour mark to set up an exciting final half hour.
Hearts goalkeeper Gordon pulled off two double saves to deny the visitors a point.
"In terms of play, I thought we matched them for large spells of the game," McPake said.
“They’re a good side and that’s why they are top of the league but I think we showed a bit of character to get back in the game at 2-0 down and when we got that goal back it looked like only one team was going to score if there was another goal to be scored.
"I think they have got their goalkeeper to be thanked for giving them all three points today.
“He’s a top class goalkeeper and he made big saves at big moments in the game.
"Sometimes you just hold your hands up and a bit of hard luck as well. I don’t like talking about luck because it is not something I go into.
“Their second goal, the boy doesn’t know anything about it. It's a good save from Jack and it hits him and goes in. It's fine margins and that was the difference today.”
‘Gutted for the players’
McPake, while admitting to being “gutted”, acknowledged it was a much better outing than their previous visit to Tynecastle.
He said: "Going a goal down, we’ve been here before and took a bit of a doing that day, that obviously comes into play because it is our first time back. Deep down we knew that wasn’t going to happen today but you think just go and have a go and they did.
"We created chances and finally got to grips with the way Hearts were playing the diamond. We gave it a go. I’m standing here sounding gutted but I’m not gutted for me, I’m gutted for my players because I've been here twice now this season. I’ve been in and seen a set of players who didn't turn up on the day and deservedly got absolutely battered then today I walk in and see a set of players who are absolutely gutted because they put so much into a game.
"It's them I feel for because they know they should have come away with a point from the game today.
"That’s not taking anything away from Hearts. Hearts played well in the game and exploited us in certain areas at times and showed why they are top of the league and a massive factor is their goalkeeper.”
McPake and Hearts boss Robbie Neilson were involved in a long chat following the sending off of Peter Haring. A chat which lasted after full-time.
The Dundee manager revealed the reason for a difference of opinion was not about the red card but for “a lot of reasons”.
McPake said: “It was late on in the game and Robbie is already out shouting it will be rescinded so he can clearly see into the future which is fine.
"What I will say is I thought the referee handled the game very well.”