McGinn netted 10 minutes into each half in front of 10,175 fans at Pittodrie to keep them in the race for the top half ahead of their trip to Dundee United next Saturday, after which the Clydesdale Bank Premier League splits in two and Brown steps down.
Hearts created a number of first-half chances with John Sutton hitting the post but their only real positive after the break was the introduction of right-back Jamie Hamill for his first appearance since damaging a cruciate ligament almost a year ago.
Aberdeen had not scored against Hearts in nine games but Gavin Rae could have ended the goal drought in the second minute when Josh Magennis and Scott Vernon combined to set him up in space 16 yards out but he volleyed over.
The Dons went ahead in the 10th minute, when Rae's pass set Hayes free down the right and he ran towards goal before rolling the ball inside for McGinn to shoot into the empty net.
The Northern Ireland was on target again 10 minutes after the break, when he cut in from the left, turned Dylan McGowan one way and the next and then curled the ball into the top corner from a tight angle.
The former Celtic player soon had a chance for a hat-trick after Johnny Hayes ran from his own half and crossed to the far post but his shot was blocked.
McGinn was then booked for simulation after going down under Danny Wilson's penalty-box challenge. The tackle looked clumsy and there appeared to be contact from a distance but referee Willie Collum immediately produced the card.
Aberdeen survived some late scares before Brown and assistant Archie Knox received a warm ovation as they made their way to the tunnel.
- Sports & Recreation
- Clydesdale Bank Premier League