Early goals from Brad McKay and Jamie Hamill enabled the Edinburgh side to secure a 2-1 victory against another team currently in administration.
Kick-off was held up for 10 minutes to allow visiting fans inside the ground, with gate receipts from the 4,538 crowd split between the two clubs.
And Locke said: "I can't speak highly enough of our support and what they have done for the club.
"It's incredible and they certainly deserve a good team on the pitch. When you come out to a pre-season friendly and see the whole away end full of maroon scarves and jerseys, it gave me a lift and you could see in the first half that it gave the players a lift."
Hearts fans are among three bidders to purchase the club after more than 5,500 set up direct debits to fund the Foundation of Hearts offer.
Administrators BDO will have to select a preferred bidder from three rival groups. In addition to the Foundation, one other is backed by American cash while the third involves Angelo Massone.
A surge in season-ticket sales has helped the club continue trading in the short term and Locke said of BDO: "They have been great from day one. The fans know exactly what's happening - three bids in.
"All in all there is light at the end of the tunnel, we are moving in the right direction, and that's all everyone has wanted since the day we went into administration."
Regarding Dunfermline, a fans' alliance named Pars United is the preferred bidder ahead of a creditors meeting onJuly 30.
Dunfermline manager Jim Jefferies said: "Who has ever heard of a game like this being held up for 10 minutes to let the crowd in?
"That's because of a tremendous response from the fans of both clubs. I think they saw a lot of good young talent, which serves well for both clubs."
The match, for the Supporters Direct Cup, was arranged to mark the efforts of both sets of fans to save their respective clubs
As for the game, McKay headed home David Smith's near-post corner after nine minutes, while Hamill added a second from the penalty spot on 19 after Smith was fouled by Chris Kane.
Dunfermline improved after the break and Ryan Thomson pulled a goal back just after the hour mark following good work by Josh Falkingham.