﻿<?xml version="1.0" encoding="utf-8"?>
<InstanceReport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Version>2.2.0.7</Version>
  <hasSegments>false</hasSegments>
  <ReportName>Stock-based Compensation</ReportName>
  <ReportLongName>1110 - Disclosure - Stock-based Compensation</ReportLongName>
  <DisplayLabelColumn>true</DisplayLabelColumn>
  <ShowElementNames>false</ShowElementNames>
  <RoundingOption />
  <HasEmbeddedReports>false</HasEmbeddedReports>
  <Columns>
    <Column>
      <LabelColumn>false</LabelColumn>
      <Id>1</Id>
      <Labels>
        <Label Id="1" Label="9 Months Ended" />
        <Label Id="2" Label="Jun. 30, 2010" />
      </Labels>
      <CurrencyCode>USD</CurrencyCode>
      <FootnoteIndexer />
      <hasSegments>false</hasSegments>
      <hasScenarios>false</hasScenarios>
      <Segments />
      <Scenarios />
      <Units>
        <Unit>
          <UnitID>USD</UnitID>
          <UnitType>Standard</UnitType>
          <StandardMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/iso4217</MeasureSchema>
            <MeasureValue>USD</MeasureValue>
            <MeasureNamespace>iso4217</MeasureNamespace>
          </StandardMeasure>
          <Scale>0</Scale>
        </Unit>
        <Unit>
          <UnitID>USDPerShare</UnitID>
          <UnitType>Divide</UnitType>
          <NumeratorMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/iso4217</MeasureSchema>
            <MeasureValue>USD</MeasureValue>
            <MeasureNamespace>iso4217</MeasureNamespace>
          </NumeratorMeasure>
          <DenominatorMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/instance</MeasureSchema>
            <MeasureValue>shares</MeasureValue>
            <MeasureNamespace>xbrli</MeasureNamespace>
          </DenominatorMeasure>
          <Scale>0</Scale>
        </Unit>
        <Unit>
          <UnitID>Shares</UnitID>
          <UnitType>Standard</UnitType>
          <StandardMeasure>
            <MeasureSchema>http://www.xbrl.org/2003/instance</MeasureSchema>
            <MeasureValue>shares</MeasureValue>
            <MeasureNamespace>xbrli</MeasureNamespace>
          </StandardMeasure>
          <Scale>0</Scale>
        </Unit>
      </Units>
      <CurrencySymbol>$</CurrencySymbol>
    </Column>
  </Columns>
  <Rows>
    <Row>
      <Id>2</Id>
      <Label>Stock-based Compensation</Label>
      <Level>0</Level>
      <ElementName>nty_StockBasedCompensationDisclosureAbstract</ElementName>
      <ElementPrefix>nty</ElementPrefix>
      <IsBaseElement>false</IsBaseElement>
      <BalanceType>na</BalanceType>
      <PeriodType>duration</PeriodType>
      <ShortDefinition>No definition available.</ShortDefinition>
      <IsReportTitle>false</IsReportTitle>
      <IsSegmentTitle>false</IsSegmentTitle>
      <IsSubReportEnd>false</IsSubReportEnd>
      <IsCalendarTitle>false</IsCalendarTitle>
      <IsTuple>false</IsTuple>
      <IsAbstractGroupTitle>true</IsAbstractGroupTitle>
      <IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow>
      <IsEquityAdjustmentRow>false</IsEquityAdjustmentRow>
      <IsBeginningBalance>false</IsBeginningBalance>
      <IsEndingBalance>false</IsEndingBalance>
      <IsReverseSign>false</IsReverseSign>
      <PreferredLabelRole />
      <IsEPS>false</IsEPS>
      <FootnoteIndexer />
      <Cells>
        <Cell>
          <Id>1</Id>
          <ShowCurrencySymbol>false</ShowCurrencySymbol>
          <IsNumeric>false</IsNumeric>
          <IsRatio>false</IsRatio>
          <DisplayZeroAsNone>false</DisplayZeroAsNone>
          <NumericAmount>0</NumericAmount>
          <RoundedNumericAmount>0</RoundedNumericAmount>
          <NonNumbericText />
          <NonNumericTextHeader />
          <FootnoteIndexer />
          <hasSegments>false</hasSegments>
          <hasScenarios>false</hasScenarios>
          <DisplayDateInUSFormat>false</DisplayDateInUSFormat>
        </Cell>
      </Cells>
      <OriginalInstanceReportColumns />
      <ElementDataType>xbrli:stringItemType</ElementDataType>
      <SimpleDataType>string</SimpleDataType>
      <ElementDefenition>No definition available.</ElementDefenition>
      <IsTotalLabel>false</IsTotalLabel>
    </Row>
    <Row>
      <Id>3</Id>
      <Label>Stock-based Compensation</Label>
      <Level>1</Level>
      <ElementName>us-gaap_DisclosureOfCompensationRelatedCostsShareBasedPaymentsTextBlock</ElementName>
      <ElementPrefix>us-gaap</ElementPrefix>
      <IsBaseElement>true</IsBaseElement>
      <BalanceType>na</BalanceType>
      <PeriodType>duration</PeriodType>
      <ShortDefinition>No definition available.</ShortDefinition>
      <IsReportTitle>false</IsReportTitle>
      <IsSegmentTitle>false</IsSegmentTitle>
      <IsSubReportEnd>false</IsSubReportEnd>
      <IsCalendarTitle>false</IsCalendarTitle>
      <IsTuple>false</IsTuple>
      <IsAbstractGroupTitle>false</IsAbstractGroupTitle>
      <IsEquityPrevioslyReportedAsRow>false</IsEquityPrevioslyReportedAsRow>
      <IsEquityAdjustmentRow>false</IsEquityAdjustmentRow>
      <IsBeginningBalance>false</IsBeginningBalance>
      <IsEndingBalance>false</IsEndingBalance>
      <IsReverseSign>false</IsReverseSign>
      <PreferredLabelRole>terselabel</PreferredLabelRole>
      <IsEPS>false</IsEPS>
      <FootnoteIndexer />
      <Cells>
        <Cell>
          <Id>1</Id>
          <ShowCurrencySymbol>false</ShowCurrencySymbol>
          <IsNumeric>false</IsNumeric>
          <IsRatio>false</IsRatio>
          <DisplayZeroAsNone>false</DisplayZeroAsNone>
          <NumericAmount>0</NumericAmount>
          <RoundedNumericAmount>0</RoundedNumericAmount>
          <NonNumbericText>&lt;table style="font-size:10pt; font-family:'Times New Roman',times,serif;"&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;p style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&lt;b&gt;11. Stock-based Compensation&lt;/b&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;On December&amp;nbsp;23, 2009, the Company granted 287 stock options to directors and certain employees under the 2008 and 2000 Stock Option Plans. These stock options were granted with an exercise price of $43.88, the closing price of the Company's common stock on the date of grant. The vesting period for these options is over four years, in three equal increments on each of the second, third and fourth anniversary of the date of grant, except those granted to Harvey Kamil, President and Chief Financial Officer, the vesting of which will accelerate if he retires after the second anniversary of the date of grant. All stock options granted expire ten years from the date of grant. &lt;/font&gt;&lt;/p&gt;
&lt;p style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;The weighted average fair value per share of the options granted was $22.13. The fair value of each option award is estimated on the date of grant using a Black-Scholes-Merton option pricing model. The following weighted average assumptions were used for the options granted in December 2009: &lt;/font&gt;&lt;/p&gt;
&lt;div style="PADDING-RIGHT: 0pt; PADDING-LEFT: 0pt; PADDING-BOTTOM: 0pt; MARGIN-LEFT: 20%; WIDTH: 60%; PADDING-TOP: 0pt; POSITION: relative"&gt;
&lt;p style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&lt;!-- COMMAND=ADD_TABLEWIDTH,"100%" --&gt;&lt;/font&gt;&lt;/p&gt;
&lt;!-- User-specified TAGGED TABLE --&gt;
&lt;div align="center"&gt;
&lt;table cellspacing="0" cellpadding="0" width="100%" border="0"&gt;
&lt;tr style="HEIGHT: 0px"&gt;&lt;!-- TABLE COLUMN WIDTHS SET --&gt;
&lt;td style="FONT-FAMILY: times" align="left"&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times" width="12"&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times" align="right" width="7"&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times" width="26"&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times" width="12"&gt;&lt;/td&gt;&lt;!-- TABLE COLUMN WIDTHS END --&gt;&lt;/tr&gt;
&lt;tr style="HEIGHT: 0px" valign="bottom" bgcolor="#CCEEFF"&gt;
&lt;td style="FONT-FAMILY: times"&gt;
&lt;p style="MARGIN-LEFT: 10pt; TEXT-INDENT: -10pt; FONT-FAMILY: times"&gt;&lt;font size="2"&gt;Risk-free rate(1)&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times" align="right"&gt;&lt;font size="2"&gt;2.9&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;%&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="HEIGHT: 0px" valign="bottom" bgcolor="white"&gt;
&lt;td style="FONT-FAMILY: times"&gt;
&lt;p style="MARGIN-LEFT: 10pt; TEXT-INDENT: -10pt; FONT-FAMILY: times"&gt;&lt;font size="2"&gt;Expected term(2)&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times" align="right"&gt;&lt;font size="2"&gt;6.4&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="HEIGHT: 0px" valign="bottom" bgcolor="#CCEEFF"&gt;
&lt;td style="FONT-FAMILY: times"&gt;
&lt;p style="MARGIN-LEFT: 10pt; TEXT-INDENT: -10pt; FONT-FAMILY: times"&gt;&lt;font size="2"&gt;Expected volatility(3)&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times" align="right"&gt;&lt;font size="2"&gt;48.0&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;%&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr style="HEIGHT: 0px" valign="bottom" bgcolor="white"&gt;
&lt;td style="FONT-FAMILY: times"&gt;
&lt;p style="MARGIN-LEFT: 10pt; TEXT-INDENT: -10pt; FONT-FAMILY: times"&gt;&lt;font size="2"&gt;Expected dividend yield&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times" align="right"&gt;&lt;font size="2"&gt;0.0&lt;/font&gt;&lt;/td&gt;
&lt;td style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;%&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;
&lt;!-- end of user-specified TAGGED TABLE --&gt;&lt;/div&gt;
&lt;div style="PADDING-RIGHT: 0pt; PADDING-LEFT: 0pt; PADDING-BOTTOM: 0pt; MARGIN-LEFT: 20%; PADDING-TOP: 0pt; POSITION: relative; TEXT-ALIGN: left"&gt;&lt;!-- COMMAND=ADD_LINERULETXT,NOSHADE  COLOR="#000000" SIZE="1.0PT" WIDTH="26%" ALIGN="LEFT" --&gt;
&lt;hr style="COLOR: #000000" align="left" width="26%" noshade="noshade" size="1" /&gt;
&lt;dl compact="compact"&gt;
&lt;dt style="MARGIN-BOTTOM: -11pt; FONT-FAMILY: times"&gt;&lt;font size="2"&gt;(1)&lt;/font&gt;&lt;/dt&gt;
&lt;dd style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;The risk-free rate is based upon the rate on a zero coupon U.S. Treasury bill, for the expected term of the option, in effect at the time of grant. &lt;br /&gt;
&lt;br /&gt;&lt;/font&gt;&lt;/dd&gt;
&lt;dt style="MARGIN-BOTTOM: -11pt; FONT-FAMILY: times"&gt;&lt;font size="2"&gt;(2)&lt;/font&gt;&lt;/dt&gt;
&lt;dd style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;The expected term of the option is based on historical employee exercise behavior, the vesting terms of the respective option and a contractual life of ten years. &lt;br /&gt;
&lt;br /&gt;&lt;/font&gt;&lt;/dd&gt;
&lt;dt style="MARGIN-BOTTOM: -11pt; FONT-FAMILY: times"&gt;&lt;font size="2"&gt;(3)&lt;/font&gt;&lt;/dt&gt;
&lt;dd style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;Expected volatility is primarily based on the daily historical volatility of our stock price, over a period similar to the expected term of the option. &lt;/font&gt;&lt;/dd&gt;&lt;/dl&gt;&lt;/div&gt;
&lt;p style="FONT-FAMILY: times"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;On December&amp;nbsp;23, 2009, the Company also granted 21 restricted stock units to directors and certain executives under the 2009 Equity Awards Plan. The closing price of the Company's common stock on the date of grant was $43.88. These restricted stock units vest over four years, in three equal increments on each of the second, third and fourth anniversary of the date of grant, except those granted to Harvey Kamil, President and Chief Financial Officer, the vesting of which will accelerate if he retires after the second anniversary of the date of grant.&lt;/font&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
</NonNumbericText>
          <NonNumericTextHeader>11. Stock-based Compensation
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;On December&amp;nbsp;23, 2009, the Company granted 287 stock options to directors and</NonNumericTextHeader>
          <FootnoteIndexer />
          <hasSegments>false</hasSegments>
          <hasScenarios>false</hasScenarios>
          <DisplayDateInUSFormat>false</DisplayDateInUSFormat>
        </Cell>
      </Cells>
      <OriginalInstanceReportColumns />
      <ElementDataType>us-types:textBlockItemType</ElementDataType>
      <SimpleDataType>textblock</SimpleDataType>
      <ElementDefenition>Disclosure of compensation-related costs for share-based compensation which may include disclosure of policies, compensation plan details, allocation of stock compensation, incentive distributions, share-based arrangements to obtain goods and services, deferred compensation arrangements, employee stock ownership plan details and employee stock purchase plan details.</ElementDefenition>
      <ElementReferences>Reference 1: http://www.xbrl.org/2003/role/presentationRef
 -Publisher FASB
 -Name Statement of Financial Accounting Standard (FAS)
 -Number 123R
 -Paragraph 64, 65, A240

Reference 2: http://www.xbrl.org/2003/role/presentationRef
 -Publisher AICPA
 -Name Statement of Position (SOP)
 -Number 93-6
 -Paragraph 53

Reference 3: http://www.xbrl.org/2003/role/presentationRef
 -Publisher SEC
 -Name Staff Accounting Bulletin (SAB)
 -Number Topic 14

</ElementReferences>
      <IsTotalLabel>false</IsTotalLabel>
    </Row>
  </Rows>
  <Footnotes />
  <NumberOfCols>1</NumberOfCols>
  <NumberOfRows>2</NumberOfRows>
  <HasScenarios>false</HasScenarios>
  <MonetaryRoundingLevel>UnKnown</MonetaryRoundingLevel>
  <SharesRoundingLevel>UnKnown</SharesRoundingLevel>
  <PerShareRoundingLevel>UnKnown</PerShareRoundingLevel>
  <HasPureData>false</HasPureData>
  <SharesShouldBeRounded>true</SharesShouldBeRounded>
</InstanceReport>
